v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1351142229.7 KB
projects

Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of contents or source_uri must be provided. If contents is provided, then spec_type must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the projects/{project}/locations/{location}/attributes/system-spec-type attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the GetSpec method. In order to access the raw contents for a particular spec, use the GetSpecContents method. In order to access the operations parsed from the spec, use the ListAPIOperations method.

post/v1/{+parent}/specs

Path parameters

parentstring required

Required. The parent resource for Spec. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}

Query parameters

specIdstring

Optional. The ID to use for the spec, which will become the final component of the spec's resource name. This field is optional. * If provided, the same will be used. The service will throw an error if the specified id is already used by another spec in the API resource. * If not provided, a system generated id will be used. This value should be 4-500 characters, overall resource name which will be of format projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}, its length is limited to 1000 characters and valid characters are /a-z[0-9]-_/.

Request body

updateTimestring google-datetime

Output only. The time at which the spec was last updated.

createTimestring google-datetime

Output only. The time at which the spec was created.

sourceUristring

Optional. The URI of the spec source in case file is uploaded from an external version control system.

attributesobject

Optional. The list of user defined attributes associated with the spec. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource.

namestring

Identifier. The name of the spec. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

parsingMode'PARSING_MODE_UNSPECIFIED' | 'RELAXED' | 'STRICT'

Optional. Input only. Enum specifying the parsing mode for OpenAPI Specification (OAS) parsing.

displayNamestring

Required. The display name of the spec. This can contain the file name of the spec.

Response

Successful response