pgjones / quart-schema

Quart-Schema is a Quart extension that provides schema validation and auto-generated API documentation.
MIT License
76 stars 24 forks source link

Add support for operationID #41

Closed mst-ableton closed 1 year ago

mst-ableton commented 1 year ago

This generates an operationID from the HTTP method and function name, or allows for overriding the part after the HTTP method.

Please let me know if I should add more testing/documentation or if there is a better approach to accomplish this!

mst-ableton commented 1 year ago

An example of where this is useful: the openapi3 library can directly make calls to endpoints with an operationID specified. Here's a theoretical example based on the quart-schema README:

import requests
from openapi3 import OpenAPI

api = OpenAPI(requests.get('http://localhost:8080/openapi.json').get_json())

api.call_post_create_todo(data={'todo': {'task': 'buy milk'}})
pgjones commented 1 year ago

Looks good to me, thanks.

DanielHabenicht commented 1 month ago

@mst-ableton Was there a rationale behind including the http method always? Asking because of #88