0b01001001/spectree

Setting Swagger fields in `info`

dhruvkb opened this issue · 4 comments

Describe the bug
Swagger provides the option to define many more fields under info such as:

  • termsOfService
  • license
    • license.name
    • license.url
  • contact
    • contact.email

There is no documented way to set these fields in the generated Swagger file.

Expected behavior
There should be a way to configure these fields.

Python Information (please complete the following information):

  • Python v3.10.1
  • Spectree v0.6.8
  • Falcon v3.0.1

Thanks for your feedback.

Will find a time to support this.

Hi @dhruvkb, this feature has been supported.

You can try it with version >= 0.7.0

Check the example:

api = SpecTree(
"falcon",
title="Demo Service",
version="0.1.2",
contact={"name": "John", "email": "hello@github.com", "url": "https://github.com"},
license={"name": "MIT", "url": "https://opensource.org/licenses/MIT"},
)

@kemingy am I correct in understanding that it only supports the following fields?

  • title
  • version
  • description
  • termsOfService
  • contact
  • license

@dhruvkb Correct. According to the OpenAPI Spec - Info