You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/09 06:01:28 UTC

[GitHub] [apisix-dashboard] nic-chen opened a new pull request #992: docs: use Swagger to maintain API document for Manager API

nic-chen opened a new pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [x] Documentation
   
   - Related issues
   
   close #973
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-742988197


   @nic-chen why we need file `docs/api/api.yaml`?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539182140



##########
File path: api/internal/handler/handler.go
##########
@@ -1,19 +1,21 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// API doc of Manager API.

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540743582



##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--

Review comment:
       generated automatically




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-741553929


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=h1) Report
   > Merging [#992](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=desc) (ba2bb2b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/64cd555d8acdcc111a65ef1a00f1f20980a9f259?el=desc) (64cd555) will **increase** coverage by `0.07%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/992/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #992      +/-   ##
   ==========================================
   + Coverage   41.73%   41.80%   +0.07%     
   ==========================================
     Files          23       23              
     Lines        1428     1428              
   ==========================================
   + Hits          596      597       +1     
   + Misses        741      740       -1     
     Partials       91       91              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | `82.35% <ø> (ø)` | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `34.92% <ø> (ø)` | |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.56% <ø> (ø)` | |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.65% <ø> (ø)` | |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `28.17% <ø> (ø)` | |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `19.82% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.22% <0.00%> (+0.64%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=footer). Last update [64cd555...ba2bb2b](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539152195



##########
File path: api/internal/handler/handler.go
##########
@@ -1,19 +1,21 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// API doc of Manager API.

Review comment:
       we can not delete the ASF header

##########
File path: docs/FAQ.md
##########
@@ -54,3 +54,21 @@ $ api/build-tools/schema-sync.sh /usr/local/apisix
 ```
 
 After the command finishes executing, if you are using a binary `manager-api` that has already been built, you will need to manually copy `api/conf/schema.json` to the `conf` directory under the Dashboard **working directory**. where **working directory** refers to the `conf` directory under this [document](./deploy.md) is the `output` directory, or the directory with the modified name, that is generated in the root directory after the build is complete.
+
+### 5. How to write api interface documentation
+
+We use [go-swagger](https://github.com/go-swagger/go-swagger) to generate Swagger 2.0 documents, and then convert them to markdown format so that they can be viewed directly in the github repository. Specific steps are as follows:
+
+1. Write comments according to [Specification](https://goswagger.io/use/spec.html). For details, please refer to the existing example `api/internal/handler/route/route.go` in this project.
+
+2. Use the `go-swagger` tool to generate Swagger 2.0 documents.
+
+```shell
+$ swagger generate spec -o ./docs/api/api.yaml --scan-models

Review comment:
       we can move those to `Makefile`

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key

Review comment:
       The period is missing

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Description:
+
+check SSL exists or not by sni

Review comment:
       ditto, please fix similar points

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.
+
+## Version: 2.2
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Summary:
+
+verify SSL cert and key
+
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Summary:
+
+check SSL exists or not
+
+##### Description:
+
+check SSL exists or not by sni
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Summary:
+
+Returns consumer list
+
+##### Description:
+
+Return the consumer list according to the specified page number and page size, and can search by username

Review comment:
       `and can search by username`
   to
   `and support to search "consumer" by username`

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Description:
+
+check SSL exists or not by sni
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Description:
+
+Return the consumer list according to the specified page number and page size, and can search by username
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| username | query | username of consumer | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [consumer](#consumer) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/notexist/routes
+
+#### GET
+##### Description:
+
+Returns result of route exists checking by name and exclude id
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| name | query | name of route | No | string |
+| exclude | query | id of route that exclude checking | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | route not exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/routes
+
+#### GET
+##### Description:
+
+Return the route list according to the specified page number and page size, and can search by name and uri
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| name | query | name of route | No | string |
+| uri | query | uri of route | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [route](#route) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/services
+
+#### GET
+##### Description:
+
+Return the service list according to the specified page number and page size, and can search by name
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| name | query | name of service | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [service](#service) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/ssl
+
+#### GET
+##### Description:
+
+Return the SSL list according to the specified page number and page size, and can search by sni
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| sni | query | sni of SSL | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [ssl](#ssl) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/upstreams
+
+#### GET
+##### Description:
+
+Return the upstream list according to the specified page number and page size, and can search by name
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| name | query | name of upstream | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [upstream](#upstream) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/user/login
+
+#### POST
+##### Description:
+
+user login
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| username | body | user name | Yes | string |
+| password | body | password | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | login success | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### Models
+
+
+#### ApiError
+
+| Name | Type | Description | Required |
+| ---- | ---- | ----------- | -------- |
+| code | long | response code | No |
+| message | string | response message | No |
+
+#### BaseInfo
+
+| Name | Type | Description | Required |
+| ---- | ---- | ----------- | -------- |
+| create_time | long |  | No |
+| id | object |  | No |
+| update_time | long |  | No |
+
+#### Consumer
+
+| Name | Type | Description | Required |
+| ---- | ---- | ----------- | -------- |
+| create_time | long |  | No |
+| desc | string |  | No |
+| id | object |  | No |
+| labels | object |  | No |
+| plugins | object |  | No |
+| update_time | long |  | No |
+| username | string |  | No |
+
+#### LoginInput
+
+| Name | Type | Description | Required |
+| ---- | ---- | ----------- | -------- |
+| password | string | password | No |
+| username | string | user name | No |
+
+#### Route

Review comment:
       I think we can do this later.  
   
   and we can add `SSL`, `Service`, `Upstream` later too

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Description:
+
+check SSL exists or not by sni

Review comment:
       `check SSL exists or not by sni`, not easy to understand

##########
File path: docs/FAQ.md
##########
@@ -54,3 +54,21 @@ $ api/build-tools/schema-sync.sh /usr/local/apisix
 ```
 
 After the command finishes executing, if you are using a binary `manager-api` that has already been built, you will need to manually copy `api/conf/schema.json` to the `conf` directory under the Dashboard **working directory**. where **working directory** refers to the `conf` directory under this [document](./deploy.md) is the `output` directory, or the directory with the modified name, that is generated in the root directory after the build is complete.
+
+### 5. How to write api interface documentation
+
+We use [go-swagger](https://github.com/go-swagger/go-swagger) to generate Swagger 2.0 documents, and then convert them to markdown format so that they can be viewed directly in the github repository. Specific steps are as follows:
+
+1. Write comments according to [Specification](https://goswagger.io/use/spec.html). For details, please refer to the existing example `api/internal/handler/route/route.go` in this project.
+
+2. Use the `go-swagger` tool to generate Swagger 2.0 documents.
+
+```shell
+$ swagger generate spec -o ./docs/api/api.yaml --scan-models
+```
+
+3. Use the `swagger-markdown` tool to convert Swagger 2.0 documents into markdown documents.
+
+```shell
+$ swagger-markdown -i ./docs/api/api.yaml

Review comment:
       ditto




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540722978



##########
File path: api/internal/handler/handler.go
##########
@@ -14,6 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+// API doc of Manager API.
+//
+// Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.

Review comment:
       Always Apache APISIX

##########
File path: api/internal/handler/upstream/upstream.go
##########
@@ -85,6 +85,40 @@ type ListInput struct {
 	store.Pagination
 }
 
+// swagger:operation GET /apisix/admin/upstreams getSSLList

Review comment:
       SSLList?

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.

Review comment:
       Apache APISIX

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--

Review comment:
       This file is generated automatically or maintain by ourseleves?

##########
File path: docs/FAQ.zh-CN.md
##########
@@ -0,0 +1,74 @@
+<!--

Review comment:
       We don't have docs in Chinese anymore, please sync the latest codes from master.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-742998564


   > @nic-chen why we need file `docs/api/api.yaml`?
   
   ok, I think we could remove it


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-742986853


   ping @membphis @tokers 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on a change in pull request #992: docs: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539060028



##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.

Review comment:
       The Manager API does not only provide services for the frontend.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.
+
+## Version: 2.2

Review comment:
       Can we delete this line? It seems useless

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.
+
+## Version: 2.2
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Summary:
+
+verify SSL cert and key
+
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Summary:
+
+check SSL exists or not
+
+##### Description:
+
+check SSL exists or not by sni
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Summary:
+
+Returns consumer list
+
+##### Description:
+
+Return the consumer list according to the specified page number and page size, and can search by username

Review comment:
       ![image](https://user-images.githubusercontent.com/6814606/101596805-ba196600-3a30-11eb-957e-9d191c9c2a64.png)
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-741553929


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=h1) Report
   > Merging [#992](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=desc) (2273b7f) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/ffcecfa7909b6a8b6a869fdd63b0e0542aa74bb5?el=desc) (ffcecfa) will **decrease** coverage by `0.07%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/992/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #992      +/-   ##
   ==========================================
   - Coverage   44.04%   43.96%   -0.08%     
   ==========================================
     Files          18       18              
     Lines        1310     1310              
   ==========================================
   - Hits          577      576       -1     
   - Misses        642      643       +1     
     Partials       91       91              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | `82.35% <ø> (ø)` | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `34.92% <ø> (ø)` | |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.56% <ø> (ø)` | |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.65% <ø> (ø)` | |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `28.17% <ø> (ø)` | |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `19.82% <ø> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `78.57% <0.00%> (-0.65%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=footer). Last update [ffcecfa...4cec9ee](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540745594



##########
File path: docs/FAQ.zh-CN.md
##########
@@ -0,0 +1,74 @@
+<!--

Review comment:
       removed.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.

Review comment:
       fixed.

##########
File path: api/internal/handler/handler.go
##########
@@ -14,6 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+// API doc of Manager API.
+//
+// Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io commented on pull request #992: docs: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-741553929


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=h1) Report
   > Merging [#992](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=desc) (1d3c9ed) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/b8c5c0d64cf46dbd1a6b9f0e8127dfccb5b37c04?el=desc) (b8c5c0d) will **increase** coverage by `0.55%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/992/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #992      +/-   ##
   ==========================================
   + Coverage   43.49%   44.04%   +0.55%     
   ==========================================
     Files          18       18              
     Lines        1299     1310      +11     
   ==========================================
   + Hits          565      577      +12     
     Misses        642      642              
   + Partials       92       91       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | `82.35% <ø> (ø)` | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `34.92% <ø> (ø)` | |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.56% <ø> (ø)` | |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.65% <ø> (ø)` | |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `28.17% <ø> (ø)` | |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `19.82% <ø> (ø)` | |
   | [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `61.68% <0.00%> (+3.64%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=footer). Last update [b8c5c0d...1d3c9ed](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539182023



##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Description:
+
+check SSL exists or not by sni

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540018282



##########
File path: docs/FAQ.md
##########
@@ -54,3 +54,21 @@ $ api/build-tools/schema-sync.sh /usr/local/apisix
 ```
 
 After the command finishes executing, if you are using a binary `manager-api` that has already been built, you will need to manually copy `api/conf/schema.json` to the `conf` directory under the Dashboard **working directory**. where **working directory** refers to the `conf` directory under this [document](./deploy.md) is the `output` directory, or the directory with the modified name, that is generated in the root directory after the build is complete.
+
+### 5. How to write api interface documentation

Review comment:
       `api` => `API`

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Summary:
+
+verify SSL cert and key.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Summary:
+
+Check whether the SSL exists.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Summary:
+
+Return the consumer list according to the specified page number and page size, and can search consumers by username.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| username | query | username of consumer | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [consumer](#consumer) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/notexist/routes
+
+#### GET
+##### Summary:
+
+Returns result of route exists checking by name and exclude id.

Review comment:
       I saw Imperative sentences are used in other places, so here we should also use it.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #992: docs: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-741553929


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=h1) Report
   > Merging [#992](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=desc) (b2f8d80) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/b8c5c0d64cf46dbd1a6b9f0e8127dfccb5b37c04?el=desc) (b8c5c0d) will **increase** coverage by `0.55%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/992/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #992      +/-   ##
   ==========================================
   + Coverage   43.49%   44.04%   +0.55%     
   ==========================================
     Files          18       18              
     Lines        1299     1310      +11     
   ==========================================
   + Hits          565      577      +12     
     Misses        642      642              
   + Partials       92       91       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | `82.35% <ø> (ø)` | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `34.92% <ø> (ø)` | |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.56% <ø> (ø)` | |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.65% <ø> (ø)` | |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `28.17% <ø> (ø)` | |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `19.82% <ø> (ø)` | |
   | [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `61.68% <0.00%> (+3.64%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=footer). Last update [b8c5c0d...b2f8d80](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539181229



##########
File path: docs/FAQ.md
##########
@@ -54,3 +54,21 @@ $ api/build-tools/schema-sync.sh /usr/local/apisix
 ```
 
 After the command finishes executing, if you are using a binary `manager-api` that has already been built, you will need to manually copy `api/conf/schema.json` to the `conf` directory under the Dashboard **working directory**. where **working directory** refers to the `conf` directory under this [document](./deploy.md) is the `output` directory, or the directory with the modified name, that is generated in the root directory after the build is complete.
+
+### 5. How to write api interface documentation
+
+We use [go-swagger](https://github.com/go-swagger/go-swagger) to generate Swagger 2.0 documents, and then convert them to markdown format so that they can be viewed directly in the github repository. Specific steps are as follows:
+
+1. Write comments according to [Specification](https://goswagger.io/use/spec.html). For details, please refer to the existing example `api/internal/handler/route/route.go` in this project.
+
+2. Use the `go-swagger` tool to generate Swagger 2.0 documents.
+
+```shell
+$ swagger generate spec -o ./docs/api/api.yaml --scan-models

Review comment:
       OK, we could do this later, I have create an issue for it. #997




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r539104527



##########
File path: api/internal/handler/authentication/authentication.go
##########
@@ -47,11 +47,43 @@ type UserSession struct {
 	Token string `json:"token"`
 }
 
+// swagger:model LoginInput
 type LoginInput struct {
+	// user name
 	Username string `json:"username" validate:"required"`
+	// password
 	Password string `json:"password" validate:"required"`
 }
 
+// swagger:operation POST /apisix/admin/user/login userLogin
+//
+// user login
+//
+// user login

Review comment:
       duplicated?

##########
File path: api/internal/handler/service/service.go
##########
@@ -89,6 +89,42 @@ type ListInput struct {
 	store.Pagination
 }
 
+// swagger:operation GET /apisix/admin/services getServiceList
+//
+// Returns service list
+//
+// Return the service list according to the specified page number and page size, and can search by name

Review comment:
       English Style: keep the singular consistent.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540040822



##########
File path: docs/FAQ.md
##########
@@ -54,3 +54,21 @@ $ api/build-tools/schema-sync.sh /usr/local/apisix
 ```
 
 After the command finishes executing, if you are using a binary `manager-api` that has already been built, you will need to manually copy `api/conf/schema.json` to the `conf` directory under the Dashboard **working directory**. where **working directory** refers to the `conf` directory under this [document](./deploy.md) is the `output` directory, or the directory with the modified name, that is generated in the root directory after the build is complete.
+
+### 5. How to write api interface documentation

Review comment:
       fixed.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Summary:
+
+verify SSL cert and key.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Summary:
+
+Check whether the SSL exists.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Summary:
+
+Return the consumer list according to the specified page number and page size, and can search consumers by username.
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| page | query | page number | No | integer |
+| page_size | query | page size | No | integer |
+| username | query | username of consumer | No | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | list response | [ [consumer](#consumer) ] |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/notexist/routes
+
+#### GET
+##### Summary:
+
+Returns result of route exists checking by name and exclude id.

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan merged pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-742921263


   @nic-chen need you to process the `conflict` first


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-741553929


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=h1) Report
   > Merging [#992](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=desc) (4cec9ee) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/ffcecfa7909b6a8b6a869fdd63b0e0542aa74bb5?el=desc) (ffcecfa) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/992/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #992   +/-   ##
   =======================================
     Coverage   44.04%   44.04%           
   =======================================
     Files          18       18           
     Lines        1310     1310           
   =======================================
     Hits          577      577           
     Misses        642      642           
     Partials       91       91           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
   | [.../internal/handler/authentication/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvYXV0aGVudGljYXRpb24vYXV0aGVudGljYXRpb24uZ28=) | `82.35% <ø> (ø)` | |
   | [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `34.92% <ø> (ø)` | |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.56% <ø> (ø)` | |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.65% <ø> (ø)` | |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `28.17% <ø> (ø)` | |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/992/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `19.82% <ø> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=footer). Last update [ffcecfa...4cec9ee](https://codecov.io/gh/apache/apisix-dashboard/pull/992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#issuecomment-742926153


   > @nic-chen need you to process the `conflict` first
   
   updated.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540747022



##########
File path: api/internal/handler/upstream/upstream.go
##########
@@ -85,6 +85,40 @@ type ListInput struct {
 	store.Pagination
 }
 
+// swagger:operation GET /apisix/admin/upstreams getSSLList

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540016622



##########
File path: api/internal/handler/authentication/authentication.go
##########
@@ -47,11 +47,43 @@ type UserSession struct {
 	Token string `json:"token"`
 }
 
+// swagger:model LoginInput
 type LoginInput struct {
+	// user name
 	Username string `json:"username" validate:"required"`
+	// password
 	Password string `json:"password" validate:"required"`
 }
 
+// swagger:operation POST /apisix/admin/user/login userLogin
+//
+// user login
+//
+// user login

Review comment:
       fixed.

##########
File path: api/internal/handler/service/service.go
##########
@@ -89,6 +89,42 @@ type ListInput struct {
 	store.Pagination
 }
 
+// swagger:operation GET /apisix/admin/services getServiceList
+//
+// Returns service list
+//
+// Return the service list according to the specified page number and page size, and can search by name

Review comment:
       fixed.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.

Review comment:
       fixed.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.
+
+## Version: 2.2

Review comment:
       fixed.

##########
File path: docs/api/api.md
##########
@@ -0,0 +1,397 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+It's used to manage etcd and provide APIs to the frontend interface.
+
+## Version: 2.2
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Summary:
+
+verify SSL cert and key
+
+##### Description:
+
+verify SSL cert and key
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL verify passed | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/check_ssl_exists
+
+#### POST
+##### Summary:
+
+check SSL exists or not
+
+##### Description:
+
+check SSL exists or not by sni
+
+##### Parameters
+
+| Name | Located in | Description | Required | Schema |
+| ---- | ---------- | ----------- | -------- | ---- |
+| cert | body | cert of SSL | Yes | string |
+| key | body | key of SSL | Yes | string |
+
+##### Responses
+
+| Code | Description | Schema |
+| ---- | ----------- | ------ |
+| 0 | SSL exists | [ApiError](#ApiError) |
+| default | unexpected error | [ApiError](#ApiError) |
+
+### /apisix/admin/consumers
+
+#### GET
+##### Summary:
+
+Returns consumer list
+
+##### Description:
+
+Return the consumer list according to the specified page number and page size, and can search by username

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540745476



##########
File path: api/internal/handler/upstream/upstream.go
##########
@@ -85,6 +85,40 @@ type ListInput struct {
 	store.Pagination
 }
 
+// swagger:operation GET /apisix/admin/upstreams getSSLList

Review comment:
       SSL List @juzhiyuan 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #992: feat: use Swagger to maintain API document for Manager API

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #992:
URL: https://github.com/apache/apisix-dashboard/pull/992#discussion_r540017248



##########
File path: docs/api/api.md
##########
@@ -0,0 +1,359 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# API doc of Manager API.
+Manager API directly operates ETCD and provides data management for APISIX, provides APIs for Front-end or other clients.
+
+**License:** [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+### /apisix/admin/check_ssl_cert
+
+#### POST
+##### Description:
+
+verify SSL cert and key

Review comment:
       fixed.




----------------------------------------------------------------
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:
users@infra.apache.org