Issue while converting to OpenAPI
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 279
- PR merge metrics
- No merged PRs in 30d
Description
We need to use GCP OpenAPI specification for one of our use case, but we found that OpenAPI specs aren't available.
So we are using Google API discovery format (https://www.googleapis.com/discovery/v1/apis) and converting it to OpenAPI spec.
Parser to parse discovery format: github.com/googleapis/gnostic/conversions
Converter to convert discovery to Open API format: github.com/googleapis/gnostic/discovery
Conversion is successful but the generated open api specs has certain issues i will mention one below.
Below is one of the operation.
If you look at the endpoint it has one path param as `parent`, and if you look in the param description, parent path param can be expanded to `projects/*/locations/*/keyRings/*`. If you are writing some automation around this to call this apis, this becomes the problem because we cannot be sure how the parent path param can be expanded & to know this we need to read the description which might not be good idea.
So wanted to know if there is any way we can get the complete path along with all the param definition in the open api spec.
```
/v1/parent/cryptoKeys:
get:
description: Lists CryptoKeys.
operationId: cloudkms.projects.locations.keyRings.cryptoKeys.list
parameters:
- name: filter
in: query
description: Optional. Only include resources that match the filter in the response. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering).
schema:
type: string
- name: orderBy
in: query
description: Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering).
schema:
type: string
- name: pageSize
in: query
description: Optional. Optional limit on the number of CryptoKeys to include in the response. Further CryptoKeys can subsequently be obtained by including the ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: Optional. Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token.
schema:
type: string
- name: parent
in: path
description: Required. The resource name of the KeyRing to list, in the format `projects/*/locations/*/keyRings/*`.
required: true
schema:
type: string
```
Contributor guide
Assessment
This issue has not been assessed yet.