# REST Resource: projects.locations.apis.versions.definitions

- [Resource: Definition](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Definition)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Definition.SCHEMA_REPRESENTATION)
- [Schema](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Schema)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Schema.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Type)
- [Methods](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#METHODS_SUMMARY)

## Resource: Definition

Represents a definition for example schema, request, response definitions contained in an API version. A definition is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, definition will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object is supported.

| JSON representation |
|---|
| ``` { "name": string, "spec": string, "type": enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Type`), "createTime": string, "updateTime": string, "attributes": { string: { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/AttributeValues`) }, ... }, // Union field `value` can be only one of the following: "schema": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Schema`) } // End of list of possible types for union field `value`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The name of the definition. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` |
| `spec` | `string` Output only. The name of the spec from where the definition was parsed. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` |
| `type` | ``enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Type`)`` Output only. The type of the definition. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which the definition was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which the definition was last updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `attributes` | ``map (key: string, value: object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/AttributeValues`))`` Optional. The list of user defined attributes associated with the definition resource. 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. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| Union field `value`. `value` can be only one of the following: ||
| `schema` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions#Schema`)`` Output only. The value of a schema definition. |

## Schema

The schema details derived from the spec. Currently, this entity is supported for OpenAPI spec only. For OpenAPI spec, this maps to the schema defined in the `definitions` section for OpenAPI 2.0 version and in `components.schemas` section for OpenAPI 3.0 and 3.1 version.

| JSON representation |
|---|
| ``` { "displayName": string, "rawValue": string } ``` |

| Fields ||
|---|---|
| `displayName` | `string` Output only. The display name of the schema. This will map to the name of the schema in the spec. |
| `rawValue` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The raw value of the schema definition corresponding to the schema name in the spec. A base64-encoded string. |

## Type

Enumeration of definition types.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Definition type unspecified. |
| `SCHEMA` | Definition type schema. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.definitions/get` | Get details about a definition in an API version. |