Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI 3.1.0 Documentation Generation #42

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

smt5541
Copy link
Collaborator

@smt5541 smt5541 commented Jun 18, 2024

🛠 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

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

N/A

  • Are the changes backwards compatible?

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

✨ Quality check

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

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

💬 Additional comments

Feel free to add any further information below

@smt5541 smt5541 self-assigned this Jun 18, 2024
@smt5541 smt5541 mentioned this pull request Jun 28, 2024
@smt5541 smt5541 force-pushed the dev/smt5541/openapi branch from 61f19e2 to 87d9f4b Compare June 30, 2024 05:00
@smt5541 smt5541 requested a review from Ge0rg3 August 14, 2024 22:50
@smt5541 smt5541 changed the title Draft: OpenAPI 3.1.0 Documentation Generation OpenAPI 3.1.0 Documentation Generation Aug 14, 2024
@smt5541 smt5541 marked this pull request as ready for review August 14, 2024 22:50
@smt5541 smt5541 marked this pull request as draft August 15, 2024 13:35
…re ending with a function name, which could be satisfied incorrectly if one function's name was the end of another function name
@smt5541 smt5541 marked this pull request as ready for review August 19, 2024 13:32
return schema


def generate_openapi_paths_object():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we add some comments/spacing to this function? It is quite tricky to understand the flow atm. Otherwise looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants