Closed sripathivenky closed 2 years ago
Added ability to pass API spec to pass as a string via spec field to api_doc. This was swagger-UI-py can be used in connection with libraries like apices
spec_string = '{"paths": {"/random": {"get": {"description": "Get a random pet", "security": [{"ApiKeyAuth": []}],' \ ' "responses": {"200": {"description": "Return a pet", "content": {"application/json":' \ ' {"schema": {"$ref": "#/components/schemas/Pet"}}}}}}}}, ' \ '"info": {"title": "Swagger Petstore", "version": "1.0.0"},' \ ' "openapi": "3.0.0", "servers" : [ {"url": "http://127.0.0.1:8989/api"}],' \ ' "components": {"schemas": {"Category": {"type": "object", "properties": ' \ '{"id": {"type": "integer"}, "name": {"type": "string"}}, "required": ["name"]}, "Pet": ' \ '{"type": "object", "properties": {"categories": {"type": "array", "items": ' \ '{"$ref": "#/components/schemas/Category"}}, "name": {"type": "string"}}}}, "securitySchemes": ' \ '{"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-API-Key"}}}}' api_doc(app, spec=spec_string, url_prefix='/api/doc/')
Added ability to pass API spec to pass as a string via spec field to api_doc. This was swagger-UI-py can be used in connection with libraries like apices
spec_string = '{"paths": {"/random": {"get": {"description": "Get a random pet", "security": [{"ApiKeyAuth": []}],' \ ' "responses": {"200": {"description": "Return a pet", "content": {"application/json":' \ ' {"schema": {"$ref": "#/components/schemas/Pet"}}}}}}}}, ' \ '"info": {"title": "Swagger Petstore", "version": "1.0.0"},' \ ' "openapi": "3.0.0", "servers" : [ {"url": "http://127.0.0.1:8989/api"}],' \ ' "components": {"schemas": {"Category": {"type": "object", "properties": ' \ '{"id": {"type": "integer"}, "name": {"type": "string"}}, "required": ["name"]}, "Pet": ' \ '{"type": "object", "properties": {"categories": {"type": "array", "items": ' \ '{"$ref": "#/components/schemas/Category"}}, "name": {"type": "string"}}}}, "securitySchemes": ' \ '{"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-API-Key"}}}}' api_doc(app, spec=spec_string, url_prefix='/api/doc/')