Question: your write that the OpenAPI spec can be written in YAML as well. While this is true according to the OpenAPI rules, the Mojolicious::Plugin::OpenAPI plugin only accepts JSON, AFAIK.
Or am I missing some hidden feature?
Since you mentioned, I also tried to look at documentation of Mojolicious::Plugin::OpenAPI and I found only one reference of yaml. Also I haven't found any example of yaml. Maybe the documentation can be improved with some trivial example in .yaml format also.
I tried to use the yaml equivalent in my current code and its working. I have update it above. Mojolicious::Plugin::OpenAPI is internaly using YAML::XS and I have found it in this version.
It also internally use JSON::Validator which support following schema format.
So, yes the plugin support .yaml format file also.
Yep, thanks. I just tried with another app I have. I recall trying before and the plugin was throwing errors. But I guess that was more due to the way I converted JSON to YAML. Syntax errors in a YAML spec are well-reported. Schema errors OTOH are much less clear in the YAML case.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Question: your write that the OpenAPI spec can be written in YAML as well. While this is true according to the OpenAPI rules, the
Mojolicious::Plugin::OpenAPI
plugin only accepts JSON, AFAIK.Or am I missing some hidden feature?
Since you mentioned, I also tried to look at documentation of
Mojolicious::Plugin::OpenAPI
and I found only one reference of yaml. Also I haven't found any example of yaml. Maybe the documentation can be improved with some trivial example in .yaml format also.I tried to use the yaml equivalent in my current code and its working. I have update it above.
Mojolicious::Plugin::OpenAPI
is internaly using YAML::XS and I have found it in this version.It also internally use JSON::Validator which support following schema format.
So, yes the plugin support .yaml format file also.
Yep, thanks. I just tried with another app I have. I recall trying before and the plugin was throwing errors. But I guess that was more due to the way I converted JSON to YAML. Syntax errors in a YAML spec are well-reported. Schema errors OTOH are much less clear in the YAML case.