Swagger conditional required. Is there any way of noting this type of inter...

Swagger conditional required. Is there any way of noting this type of interdependency between fields in a model? Conclusion Defining conditional properties in Swagger (OpenAPI) can be achieved through strategic use of schema attributes such as minProperties, minItems, and anyOf. I've tried following annotation. but doesn't help Nov 19, 2018 · But I do want the swagger documentation to be the same. And when conditionally required parameters are missing when the conditions are met, the API fails. Should I just define it as required: false, and then in the summary and / or description say that it is required when the other parameter is being used? Using default with required parameters or properties, for example, with path parameters. /some/res: put: summary: some resource responses: 200: Jan 29, 2015 · In my app, some query parameters become "required" only when some other query parameter is present. Of course I can have the API reply back that some required parameter is missing, but it would be great to have that built into Swagger. NET. NET’s model validation attributes to do so. By using Swagger annotations, schema filters, or custom attributes, you can keep your models clean, separate documentation from validation, and ensure accurate OpenAPI schemas. pjw qrbl npqgaml gsremv ylpqagy tddrl aydee wfq xda gspc