Skip to content

Commit

Permalink
fix: allow methods array to have refs
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Mar 13, 2021
1 parent f14d94e commit 709a380
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@
"type": "array",
"additionalItems": false,
"items": {
"$ref": "#/definitions/methodObject"
"title": "methodReference",
"oneOf": [
{
"$ref": "#/definitions/methodObject"
},
{
"$ref": "#/definitions/referenceObject"
}
]
}
},
"components": {
Expand Down
4 changes: 2 additions & 2 deletions src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("meta-schema", () => {
const dereffed = await deref.resolve();
expect(dereffed).toBeTruthy();
expect(dereffed.definitions).not.toBeDefined();
expect(dereffed.properties.methods.items.properties.result.oneOf[0].properties.schema.title).toBe("JSONSchema");
expect(dereffed.properties.methods.items.properties.result.oneOf[1].title).toBe("referenceObject");
expect(dereffed.properties.methods.items.oneOf[0].properties.result.oneOf[0].properties.schema.title).toBe("JSONSchema");
expect(dereffed.properties.methods.items.oneOf[0].properties.result.oneOf[1].title).toBe("referenceObject");
});
});

0 comments on commit 709a380

Please sign in to comment.