Consider allow setting up OpenAPI title, not from app name
See original GitHub issueHi,
Thanks a lot for this library, I’ve switched to it recently from flask-apispec and really pleased of its api, proper OpenAPI 3 support, and overall developer experience. One more time, thanks a lot!
And I have one thing, that I’d like to discuss. Currently flask-smorest setting up info.title
of OpenAPI 3 schema as Flask app name, but I’m not sure this is proper assumption. From my practice OAS 3 title is more likely human friendly string such as “Product API”, not an import name such as “product_api”.
With that in mind, would it be better to allow developer setup API_TITLE
via app config as done for API_VERSION
?
If you against that change, it still able to setup the title via api.spec.title
assignment, but in that case I’d like to fix title context var for redoc or swagger ui templates, to reuse the value from the spec, instead of app name.
I would be glad to provide a PR for both suggestions if you’ll agree with proposed changes
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (8 by maintainers)
Top GitHub Comments
There is no such kwarg as description in
ApiSpec
and in OpenAPI 3 Schema itself.All you need to pass it under
info
dict,In total
spec_kwargs
isoptions
passed on instatiatingApiSpec
instance, https://apispec.readthedocs.io/en/latest/api_core.html#apispec.APISpecAlso you should pass description as Markdown and it will be rendered to HTML by Swagger UI or Redoc, https://spec.openapis.org/oas/v3.0.3#info-object
@lafrech
Thanks for your update, #169 LGTM, closing my PR in favour of more complete implementation