Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only describe subkeys of "paths:" #7

Closed
wnoise opened this issue Nov 21, 2022 · 1 comment · Fixed by #12
Closed

Can only describe subkeys of "paths:" #7

wnoise opened this issue Nov 21, 2022 · 1 comment · Fixed by #12

Comments

@wnoise
Copy link

wnoise commented Nov 21, 2022

It would be useful to be able to describe schemas in the "Components" subsection of the root.

@jonschumacher
Copy link
Contributor

jonschumacher commented Jul 24, 2024

Probably not relevant anymore, but for future reference there is the option to add optional_fields as a dict:

optional_fields["components"]["schemas"]["Order"] = Dict{String, Any}(
  "title" => "Pet Order",
  "description" => "An order for a pets from the pet store",
  "type" => "object",
  "properties" => Dict{String, Any}(
    "id" => Dict{String, Any}(
      "type" => "integer",
      "format" => "int64"
    ),
    "petId" => Dict{String, Any}(
      "type" => "integer",
      "format" => "int64"
    )
  )
)


info = Dict("title" => "TestAPI", "version" => string(pkgversion(@__MODULE__)))
openApi = OpenAPI("3.0", info; optional_fields)
swagger_document = build(openApi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants