Ge0rg3 / flask-parameter-validation

Get and validate all Flask input parameters with ease.
https://pypi.org/project/Flask-Parameter-Validation/
28 stars 12 forks source link

OpenAPI 3.1.0 Documentation Generation #42

Open smt5541 opened 3 months ago

smt5541 commented 3 months ago

🛠 Changes being made

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

🧠 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

N/A

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

✨ Quality check

💬 Additional comments

Feel free to add any further information below