[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-766587292 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-766587292 > @liuxiran @nic-chen > The unit test and test cases have been supplemented. In the process of testing, I found a problem: > > * At present, the path data structure of OpenAPI 3 is used to store URIs, and the data structure is map [string]. If the URI is repeated, the data will be covered, if the repeated URIs are directly covered, only one URI can be exported, which will lead to the loss of user data. > * My idea is to add a uniform suffix after the same URI when exporting, so that the import can recognize the URI > For example: > > ``` > { >"components": {}, >"info": { >"title": "RoutesExport", >"version": "3.0.0" >}, >"openapi": "3.0.0", >"paths": { >"/hello": { >"get": {} >} >"/hello-repeaturi1": { >"get": {} >} >"/hello-repeaturi2": { >"get": {} >} >} > } > ``` > > * My method also has the risk of repeating the user named URI > * Do you have any better suggestions? We can discuss them. Thks. >OpenAPI defines a unique operation as a combination of a path and an HTTP method. This means that two GET or two POST methods for the same path are not allowed – even if they have different parameters (parameters have no effect on uniqueness) refer from https://swagger.io/docs/specification/paths-and-operations/ After communicating with @Jaycean and @nic-chen there are two alternative solutions: - A: add a uniform suffix after the same URI when exporting, and add a description to the user guide. This solution can meet the platform-wide data is not lost, the disadvantage is that when users need to use the swagger file to generate documents or sdk, they need to modified manually. - B: return error when exporting routes with same URI In this way exported OAS3.0 file can be used directly, with the disadvantage that there may be data loss for APISIX. The remedy is that we provide additional import and export of platform-wide data, in accordance with the apisix data format. Neither scheme is perfect though, which one do you perfer? any suggestions are welcome, thanks a lot @Jaycean @nic-chen @membphis @starsz @juzhiyuan @imjoey This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-766587292 > @liuxiran @nic-chen > The unit test and test cases have been supplemented. In the process of testing, I found a problem: > > * At present, the path data structure of OpenAPI 3 is used to store URIs, and the data structure is map [string]. If the URI is repeated, the data will be covered, if the repeated URIs are directly covered, only one URI can be exported, which will lead to the loss of user data. > * My idea is to add a uniform suffix after the same URI when exporting, so that the import can recognize the URI > For example: > > ``` > { >"components": {}, >"info": { >"title": "RoutesExport", >"version": "3.0.0" >}, >"openapi": "3.0.0", >"paths": { >"/hello": { >"get": {} >} >"/hello-repeaturi1": { >"get": {} >} >"/hello-repeaturi2": { >"get": {} >} >} > } > ``` > > * My method also has the risk of repeating the user named URI > * Do you have any better suggestions? We can discuss them. Thks. >OpenAPI defines a unique operation as a combination of a path and an HTTP method. This means that two GET or two POST methods for the same path are not allowed – even if they have different parameters (parameters have no effect on uniqueness) refer from https://swagger.io/docs/specification/paths-and-operations/ After communicating with @Jaycean and @nic-chen there are three alternative solutions: - A: add a uniform suffix after the same URI when exporting, and add a description to the user guide. This solution can meet the platform-wide data is not lost, the disadvantage is that when users need to use the swagger file to generate documents or sdk, they need to modified manually. - B: return error when exporting routes with same URI In this way exported OAS3.0 file can be used directly, with the disadvantage that there may be data loss for APISIX. The remedy is that we provide additional import and export of platform-wide data, in accordance with the apisix data format. Neither scheme is perfect though, which one do you perfer? any suggestions are welcome, thanks a lot @Jaycean @nic-chen @membphis @starsz @juzhiyuan @imjoey This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [x] export route with service_id(service create with upstream_id) **(test6 covered)** - [x] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [x] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [x] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [x] export route with service_id(service create with upstream_id) **(test6 covered)** - [ ] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [x] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [x] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [x] export route with service_id(service create with upstream_id) - [ ] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [x] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [x] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [ ] export route with service_id(service create with upstream_id) - [ ] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [x] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [x] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [ ] export route with service_id(service create with upstream_id) - [ ] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [x] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [ ] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 checklist: - [x] export route with host **(test2 coverd)** - [x] export route with hosts **(test1 coverd)** - [x] export route with uri **(test2 coverd)** - [x] export route with uris **(test1 coverd)** - [x] export route with upstream - [x] export route with upstream_id **(test8 coverd)** - [x] export route with service_id(service create with upstream) **(test4 coverd)** - [x] export route with upstream and service_id **(test6 coverd)** - [ ] export route with service_id(service create with upstream_id) - [ ] export route with labels and service_id(service create with labels) - [ ] export route without labels and service_id(service create with labels) - [ ] export route with plugins and service_id(service create with plugins which is not the same as route's plugins) **(test5 coverd)** - [x] export route with basic-auth plugin - [x] export route with jwt-auth plugin - [x] export route with key-auth plugin - [ ] export route with request-validation (body_schema and header_schema) plugin - [x] export two routes **(test3 coverd)** This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-765308727 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-764207165 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-764207165 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on pull request #1245: feat(BE): Export route from OpenAPI Specification3.0
liuxiran edited a comment on pull request #1245: URL: https://github.com/apache/apisix-dashboard/pull/1245#issuecomment-764207165 it would be better to add three more test cases: - export a route created with upstream id - export a route created with service which is created with upstream id - export a route enabled `basic-auth` plugin This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org