Skip to content

Commit

Permalink
fix: null example not used in schema samples
Browse files Browse the repository at this point in the history
fixes #415
  • Loading branch information
RomanHotsiy committed Feb 16, 2018
1 parent a7c3d62 commit 420c51a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/services/schema-normalizer.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('Spec Helper', () => {
});

it('should remove $allOf field', () => {
expect(joined.allOf).toBeNull();
expect(joined.allOf).toBeUndefined();
});

it('should set type object', () => {
Expand All @@ -178,7 +178,7 @@ describe('Spec Helper', () => {
});

it('should remove $allOf field', () => {
expect(joined.allOf).toBeNull();
expect(joined.allOf).toBeUndefined();
});

it('should set type object', () => {
Expand All @@ -204,7 +204,7 @@ describe('Spec Helper', () => {
});

it('should remove $allOf field', () => {
expect(joined.allOf).toBeNull();
expect(joined.allOf).toBeUndefined();
});

it('should set type object', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/schema-normalizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class AllOfMerger {
subSchema._pointer = tmpPtr;
}
if (!hadDiscriminator) into.discriminator = null;
into.allOf = null;
delete into.allOf;
}

private static mergeObject(into, subSchema, allOfNumber) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"json-schema-ref-parser": "^3.3.1",
"lunr": "^1.0.0",
"mark.js": "^8.11.1",
"openapi-sampler": "^0.4.3",
"openapi-sampler": "1.0.0-beta.8",
"perfect-scrollbar": "^0.8.1",
"prismjs": "^1.8.1",
"remarkable": "1.7.1",
Expand Down
8 changes: 5 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4676,9 +4676,11 @@ ono@^4.0.2:
dependencies:
format-util "^1.0.3"

openapi-sampler@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-0.4.3.tgz#de3aa522f45744c8349f598d4d9b6f35caaf25b2"
[email protected]:
version "1.0.0-beta.8"
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-1.0.0-beta.8.tgz#bf43ff47737fc4e1f988d0e2082d49788f41dead"
dependencies:
json-pointer "^0.6.0"

opener@~1.4.0:
version "1.4.3"
Expand Down

0 comments on commit 420c51a

Please sign in to comment.