You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using Oxygen
using SwaggerMarkdown
# Here's an example of how you can merge autogenerated docs from SwaggerMarkdown.jl into your api
@swagger """
/divide/{a}/{b}:
get:
description: Return the result of a / b
parameters:
- name: a
in: path
required: true
description: this is the value of the numerator
schema:
type : number
responses:
'200':
description: Successfully returned an number.
"""
@get "/divide/{a}/{b}" function (req, a::Float64, b::Float64)
return a / b
end
# title and version are required
info = Dict("title" => "My Demo Api", "version" => "1.0.0")
openApi = OpenAPI("3.0", info)
swagger_document = build(openApi)
# merge the SwaggerMarkdown schema with the internal schema
mergeschema(swagger_document)
# start the web server
serve()
It gives this error:
ERROR: LoadError: while parsing a block mapping at line 3, column 8: expected <block end>, but found YAML.BlockMappingStartToken at line 6, column 26
(I know this is supposed to be fixable by fixing the spacing, but I haven't been able to get it right yet, and even the example from the docs doesn't run, so I wonder if something might have changed.)
The text was updated successfully, but these errors were encountered:
This is the example from the docs:
It gives this error:
(I know this is supposed to be fixable by fixing the spacing, but I haven't been able to get it right yet, and even the example from the docs doesn't run, so I wonder if something might have changed.)
The text was updated successfully, but these errors were encountered: