flask-parameter-validation icon indicating copy to clipboard operation
flask-parameter-validation copied to clipboard

OpenAPI 3.1.0 Documentation Generation

Open smt5541 opened this issue 1 year ago • 0 comments

🛠 Changes being made

Give examples of the changes you've made in this pull request. Include an itemized list if you can.

  • Add OpenAPI 3.1.0 Responses object Generation
  • Add ability to mark routes and parameters as deprecated

🧠 Rationale behind the change

Why did you choose to make these changes?

I wanted the API documentation generated by this library to be in a standard format, and OpenAPI is commonly used, with tools like Swagger for displaying it in a convenient and useful way.

Does this pull request resolve any open issues?

Nope

Were there any trade-offs you had to consider?

Whether to continue supporting the existing documentation format:

It isn't hurting anything, most of its underlying code is needed to support OpenAPI, and has the benefit of being rendered as HTML by a built-in blueprint and template, so I've chosen to leave it in.

Handling JSON Schema of blacklist/whitelist/pattern

Because making a compound regex that properly handles a character blacklist, character whitelist and other custom regex is either impossible or near impossible, the generated OpenAPI Schema will only consider pattern

🧪 Testing

  • [X] Have tests been added or updated for the changes introduced in this pull request?

N/A

  • [X] Are the changes backwards compatible?

If the changes aren't backwards compatible, what other options were explored?

✨ Quality check

  • [X] Are your changes free of any erroneous print statements, debuggers or other leftover code?

  • [X] Has the README been updated to reflect the changes introduced (if applicable)?

💬 Additional comments

Feel free to add any further information below

smt5541 avatar Jun 18 '24 03:06 smt5541