Swagger autodoc - Document body instead of query

Product: PowerShell Universal
Version: 3.1.4

how can I get the swagger autodoc to document POST inputs as application/json (body) instead of query inputs (in the URL)?

Inside the API endpoint I can, of course, look into the header and make an if statement that throws an error, when it’s not application/json, but this will, of course, not show up in the swagger autodoc.

A good example would be the documentation for the POST /api/v1/accessControl API endpoint. There is a documented application/json body.

This is an open issue and referred to as OpenAPI Schemas: Support for OpenAPI Schemas · Issue #542 · ironmansoftware/issues · GitHub

Feel free to vote it up to increase the priority on it.

1 Like