OxygenFramework / Oxygen.jl

💨 A breath of fresh air for programming web apps in Julia
https://oxygenframework.github.io/Oxygen.jl/
MIT License
383 stars 25 forks source link

Using request body in Swagger #121

Closed DoktorMike closed 6 months ago

DoktorMike commented 10 months ago

Awesome package. :)

Just tried to try out my POST endpoint that should take a custom data format. It's not clear to me how to tell swagger to let me upload data when trying out the endpoint?

ndortega commented 10 months ago

Hi @DoktorMike,

Thanks for the kind words, and I'm sorry about the long wait.

Sadly, the built-in support for swagger generation is limited to path variables and request types. If you want to indicate other input types you can do any of the following:

Here's a link to the docs:

This section shows examples of how to do both. Granted, you'll need to change the inputs to accept a file which is basically a base64-encoded string

Here's a good SO post that covers this schema:

Here's the open-api 3.0.0 spec:

Let me know if you run into any issues or have any other questions. Additionally, If you give me a simple code snippet I can try to take a crack at it.