Closed ahopkins closed 3 years ago
exclude
openapi.definition
specification.raw()
Here is an example of how the definition decorator could be used:
definition
class Name: first_name: str last_name: str class User: name: Name @app.post("/path") @openapi.definition( operation="opeID", summary="This is a summary", description="This is a description", tag=["one", "two"], document="http://127.0.0.1:9999/doc", # body=RequestBody(content=User), body=RequestBody(User, True, "Hello"), # body=RequestBody({"application/json": {"name": str}}), # body={"*/*": User}, parameter=Parameter("foo", int), # parameter={"required": True, "name": "something"}, response=[ Response(User, status=201), Response(Name, status=400), ], # response={"application/json": User ) async def post_test(request): return json({"hello": "world"})
👍 nice thanks for that, looks like some good changes, nice to see some more robust tests as well
exclude
to OAS3openapi.definition
decorator to OAS3specification.raw()
method to OAS3 for adding specs directlyHere is an example of how the
definition
decorator could be used: