Open sammarks opened 6 years ago
In my usage of this library, I'll run into something similar to the following schema:
{ "type": "object", "required": ["name", "photoUrls"], "allOf": [ { "type": "object", "properties": { "test-one": { "type": "integer", "format": "int64" } } }, { "type": "object", "properties": { "test-two": { "type": "integer", "format": "int64", "example": 20 } } } ], "properties": { "id": { "type": "integer", "format": "int64" }, "category": { "$ref": "#/definitions/Category" }, "name": { "type": "string", "example": "doggie" }, "photoUrls": { "type": "array", "xml": { "name": "photoUrl", "wrapped": true }, "items": { "type": "string" } }, "tags": { "type": "array", "minItems": 2, "maxItems": 5, "xml": { "name": "tag", "wrapped": true }, "items": { "$ref": "#/definitions/Tag" } }, "status": { "type": "string", "description": "pet status in the store", "enum": ["available", "pending", "sold"] } }, "xml": { "name": "Pet" } }
Currently, the library doesn't generate values for test-one or test-two since they're hidden inside the allOf clause of the schema. This PR updates the response mocker to respect the allOf clause and generate values for it as well.
test-one
test-two
allOf
Any change on getting this merged in, and a new NPM release up? 🙏
In my usage of this library, I'll run into something similar to the following schema:
Currently, the library doesn't generate values for
test-one
ortest-two
since they're hidden inside theallOf
clause of the schema. This PR updates the response mocker to respect theallOf
clause and generate values for it as well.