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

[Enhancement] Respect readOnly/writeOnly and improve body sample #203

Merged
merged 7 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions demo/docs/petstore/add-pet.api.mdx

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions demo/docs/petstore/create-user.api.mdx

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions demo/docs/petstore/create-users-with-array-input.api.mdx

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions demo/docs/petstore/create-users-with-list-input.api.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/docs/petstore/delete-order.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: delete-order
sidebar_label: Delete purchase order by ID
hide_title: true
hide_table_of_contents: true
api: {"tags":["Petstore Orders"],"description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","operationId":"deleteOrder","parameters":[{"name":"orderId","in":"path","description":"ID of the order that needs to be deleted","required":true,"schema":{"type":"string","minimum":1}}],"responses":{"400":{"description":"Invalid ID supplied"},"404":{"description":"Order not found"}},"method":"delete","path":"/store/order/{orderId}","servers":[{"url":"https://petstore.swagger.io/v2","description":"Default server"},{"url":"https://petstore.swagger.io/sandbox","description":"Sandbox server"}],"securitySchemes":{"petstore_auth":{"description":"Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n","type":"oauth2","flows":{"implicit":{"authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"description":"For this sample, you can use the api key `special-key` to test the authorization filters.\n","type":"apiKey","name":"api_key","in":"header"}},"info":{"description":"This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n","version":"2.0.0","title":"Swagger Petstore YAML","termsOfService":"http://swagger.io/terms/","contact":{"name":"API Support","email":"[email protected]","url":"https://github.com/Redocly/redoc"},"x-logo":{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"postman":{"name":"Delete purchase order by ID","description":{"content":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","type":"text/plain"},"url":{"path":["store","order",":orderId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ID of the order that needs to be deleted","type":"text/plain"},"type":"any","value":"","key":"orderId"}]},"method":"DELETE"}}
api: {"tags":["store"],"description":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","operationId":"deleteOrder","parameters":[{"name":"orderId","in":"path","description":"ID of the order that needs to be deleted","required":true,"schema":{"type":"string","minimum":1}}],"responses":{"400":{"description":"Invalid ID supplied"},"404":{"description":"Order not found"}},"method":"delete","path":"/store/order/{orderId}","servers":[{"url":"https://petstore.swagger.io/v2","description":"Default server"},{"url":"https://petstore.swagger.io/sandbox","description":"Sandbox server"}],"securitySchemes":{"petstore_auth":{"description":"Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n","type":"oauth2","flows":{"implicit":{"authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"description":"For this sample, you can use the api key `special-key` to test the authorization filters.\n","type":"apiKey","name":"api_key","in":"header"}},"info":{"description":"This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n","version":"2.0.0","title":"Swagger Petstore YAML","termsOfService":"http://swagger.io/terms/","contact":{"name":"API Support","email":"[email protected]","url":"https://github.com/Redocly/redoc"},"x-logo":{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"postman":{"name":"Delete purchase order by ID","description":{"content":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors","type":"text/plain"},"url":{"path":["store","order",":orderId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ID of the order that needs to be deleted","type":"text/plain"},"type":"any","value":"","key":"orderId"}]},"method":"DELETE"}}
sidebar_class_name: "delete api-method"
info_path: petstore/swagger-petstore-yaml
---
Expand Down
2 changes: 1 addition & 1 deletion demo/docs/petstore/delete-pet.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: delete-pet
sidebar_label: Deletes a pet
hide_title: true
hide_table_of_contents: true
api: {"tags":["Pets"],"description":"","operationId":"deletePet","parameters":[{"name":"api_key","in":"header","required":false,"schema":{"type":"string"},"example":"Bearer <TOKEN>"},{"name":"petId","in":"path","description":"Pet id to delete","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"400":{"description":"Invalid pet value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}],"method":"delete","path":"/pet/{petId}","servers":[{"url":"https://petstore.swagger.io/v2","description":"Default server"},{"url":"https://petstore.swagger.io/sandbox","description":"Sandbox server"}],"securitySchemes":{"petstore_auth":{"description":"Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n","type":"oauth2","flows":{"implicit":{"authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"description":"For this sample, you can use the api key `special-key` to test the authorization filters.\n","type":"apiKey","name":"api_key","in":"header"}},"info":{"description":"This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n","version":"2.0.0","title":"Swagger Petstore YAML","termsOfService":"http://swagger.io/terms/","contact":{"name":"API Support","email":"[email protected]","url":"https://github.com/Redocly/redoc"},"x-logo":{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"postman":{"name":"Deletes a pet","description":{"content":"","type":"text/plain"},"url":{"path":["pet",":petId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Pet id to delete","type":"text/plain"},"type":"any","value":"","key":"petId"}]},"header":[{"disabled":false,"description":{"content":"","type":"text/plain"},"key":"api_key","value":""}],"method":"DELETE","auth":{"type":"oauth2","oauth2":[]}}}
api: {"tags":["pet"],"description":"","operationId":"deletePet","parameters":[{"name":"api_key","in":"header","required":false,"schema":{"type":"string"},"example":"Bearer <TOKEN>"},{"name":"petId","in":"path","description":"Pet id to delete","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"400":{"description":"Invalid pet value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}],"method":"delete","path":"/pet/{petId}","servers":[{"url":"https://petstore.swagger.io/v2","description":"Default server"},{"url":"https://petstore.swagger.io/sandbox","description":"Sandbox server"}],"securitySchemes":{"petstore_auth":{"description":"Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n","type":"oauth2","flows":{"implicit":{"authorizationUrl":"http://petstore.swagger.io/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},"api_key":{"description":"For this sample, you can use the api key `special-key` to test the authorization filters.\n","type":"apiKey","name":"api_key","in":"header"}},"info":{"description":"This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n## Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n## Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n","version":"2.0.0","title":"Swagger Petstore YAML","termsOfService":"http://swagger.io/terms/","contact":{"name":"API Support","email":"[email protected]","url":"https://github.com/Redocly/redoc"},"x-logo":{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"postman":{"name":"Deletes a pet","description":{"content":"","type":"text/plain"},"url":{"path":["pet",":petId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) Pet id to delete","type":"text/plain"},"type":"any","value":"","key":"petId"}]},"header":[{"disabled":false,"description":{"content":"","type":"text/plain"},"key":"api_key","value":""}],"method":"DELETE","auth":{"type":"oauth2","oauth2":[]}}}
sidebar_class_name: "delete api-method"
info_path: petstore/swagger-petstore-yaml
---
Expand Down
Loading