Allow additional Compliance Assertions for requests in Service-V
Hi There, It would be great if we could apply the following assertions to requests: JSON Schema Compliance Swagger Compliance Assertion The documentation around these assertions is a little conflicting as it states"Asserts that the request and response messages are compliant with a swagger definition" currently, however the implementation seems to be limited to responses only. It's quite a normal expectation that the request body for operations like PUT, PATCH, POST could be validated for compliance. Sames goes for other operations, query parameters, headers etc. We are using Service-V for API sand-boxing and ideally we should facilitate that we can act like the API provider and can easily validate requests and give appropriate responses as defined in the swagger definitions without having to script all the validations by hand. Any thoughts on this? Can you consider this enhancement? I am convinced that any customer offering REST APIs levering Swagger / Open API etc would assume such capabilities are possible for requests as well as responses. Kind regards, Frank2KViews2likes0CommentsWhat does <*> symbol represent in json swagger?
I have a question in JSON swagger. May I know what does <*> symbol represent in JSON swagger? This is how the format looks like after I import the JSON swagger into the online editor. What does <*> actually mean? CrossCurrencyRequest{ items* { < * >: CurrencyPairRequest{ amount* number currencyPair* string decimalPlace integer($int32) } } } Below are the definitions from the swagger file. definitions: CrossCurrencyRequest: type: object required: - items properties: items: type: object additionalProperties: $ref: '#/definitions/CurrencyPairRequest' title: CrossCurrencyRequest I have the sample request as given below. How to make the request generates the "key1", "key2", etc? As it seems like not a predefined object from the swagger file. Sample request: { "items": { "key1": { "amount": 1000.123456789, "currencyPair": "USD-SGD", "decimalPlace": 5 }, "key2": { "amount": 1000.12345, "currencyPair": "USD-IDR" }, "key3": { "amount": 1000.12345, "currencyPair": "USD-ZNH" } } }SolvedObject property name as UUID
In the given API response how would you write the schema yaml to support UUIDs as a property name { "results": { "11b17cd8-0000-0000-0000-2092b242027f": [ { "id": "0000", "type": "Home", "ownership": "", "monthly": "0", "address_1": "23299 Address Parts", "address_2": "", "city": "Some City", "state": "ZZ", "zip": "00000", "active": "1", "primary": "1" } ] } } Here is my attempt (schema portion): components: schemas: uuid: type: string format: uuid description: UUID example: 00000000-0000-0000-0000-000000000000 pattern: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' CustomerAddresses: type: object properties: '#/components/schemas/uuid': type: array items: $ref: '#/components/schemas/CustomerAddress' CustomerAddress: type: object properties: id: type: string example: "3014" type: type: string enum: ['Home', 'Work'] ownership: type: string example: "" monthly: type: string example: "0" address_1: type: string example: "23444 Address Parts" address_2: type: string example: "Unit 42" city: type: string example: "Some City" state: type: string maxLength: 2 minLength: 2 example: "ZZ" zip: type: string format: int32 example: "00000" active: type: string enum: ["0", "1"] primary: type: string enum: ["0", "1"]Solved