Skip to content

Commit 8866fc1

Browse files
edbznvmasek
authored andcommitted
tests: add x-nullable specs
1 parent 25df534 commit 8866fc1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/test-angular-project/src/api-tests/guards.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('TypeGuards', () => {
4444
expect(isPet(validPet)).toBeTruthy();
4545
expect(isPet({ name: 'Pes', photoUrls: [] })).toBeTruthy();
4646
expect(isPet({ ...validPet, category: { foo: 'bar' } })).toBeTruthy();
47+
expect(isPet({ ...validPet, category: null })).toBeTruthy();
4748
}));
4849

4950
test('invalid Pet is not Pet', inject([], () => {
@@ -68,6 +69,7 @@ describe('TypeGuards', () => {
6869
expect(isCustomer({ right: Right.READ_WRITE })).toBeFalsy();
6970
expect(isCustomer({ ...validCustomer, name: 42 })).toBeFalsy();
7071
expect(isCustomer({ ...validCustomer, email: 42 })).toBeFalsy(); // test for interface extend
72+
expect(isCustomer({ ...validCustomer, name: null })).toBeFalsy();
7173
}));
7274

7375
test('null is not valid object', inject([], () => {

tests/test-angular-project/swagger.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ definitions:
564564
format: 'int64'
565565
category:
566566
$ref: '#/definitions/Category'
567+
x-nullable: true
567568
name:
568569
type: 'string'
569570
example: 'doggie'
@@ -597,6 +598,7 @@ definitions:
597598
properties:
598599
name:
599600
type: 'string'
601+
x-nullable: false
600602
address:
601603
type: 'string'
602604
right:

0 commit comments

Comments
 (0)