PHPackages                             zero-to-prod/data-model-openapi30 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zero-to-prod/data-model-openapi30

ActiveLibrary[API Development](/categories/api)

zero-to-prod/data-model-openapi30
=================================

DataModels for OpenAPI 3.0.\*

v0.2.0(8mo ago)31.3k1MITPHPPHP &gt;=8.1.0CI passing

Since Nov 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/data-model-openapi30)[ Packagist](https://packagist.org/packages/zero-to-prod/data-model-openapi30)[ Docs](https://github.com/zero-to-prod/data-model-openapi30)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-data-model-openapi30/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (17)Used By (1)

Zerotoprod\\DataModelOpenapi30
==============================

[](#zerotoproddatamodelopenapi30)

[![](./art/logo.png)](./art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/data-model-openapi30)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/451c4bddb1899a6b1357cc5089291495f365c19f424fdc67a3b6d7ece504edab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933302f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/data-model-openapi30/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/93fd943774337964cf149d8e9a5d3221068d2f5dc7feaddbdf36c77a2246cf61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933302f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/data-model-openapi30/actions)[![Packagist Downloads](https://camo.githubusercontent.com/6dd09b915bf08bf450e0f8f2846113beeb7c2fd99c42ce0337a05a6f96dadcdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933303f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/data-model-openapi30/stats)[![Packagist Version](https://camo.githubusercontent.com/cb8d0d9d4bfec439dac25404ec3b33288af2302919688a033a351b02c8bebd20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933303f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/data-model-openapi30)[![License](https://camo.githubusercontent.com/6afeac97ac26ce41455d6aaf0a7528942631ad448d7c92d4c003747bc5963c8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933303f636f6c6f723d726564)](https://github.com/zero-to-prod/data-model-openapi30/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/cc42f321bda55ef497db6afad4be9ec40bda8ec343640324f7d6b80af82af7d0/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933302e737667)](https://wakatime.com/badge/github/zero-to-prod/data-model-openapi30)[![Hits-of-Code](https://camo.githubusercontent.com/71facf387eccfb1e9bb6ea90eabfb404cfdbd1aaa27229c113e07a3fd3a71096/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f646174612d6d6f64656c2d6f70656e61706933303f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/data-model-openapi30/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Publishing DataModels](#publishing-datamodels)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

DataModels for OpenAPI 3.0.\* [specification](https://spec.openapis.org/oas/v3.0.4.html).

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

Installation
------------

[](#installation)

Install `Zerotoprod\DataModelOpenapi30` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/data-model-openapi30
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/data-model-openapi30)
vendor/bin/data-model-openapi30

# Publish to custom directory
vendor/bin/data-model-openapi30 /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "data-model-openapi30"
        ],
        "post-update-cmd": [
            "data-model-openapi30"
        ]
    }
}
```

Usage
-----

[](#usage)

```
use Zerotoprod\DataModelOpenapi30\OpenApi;

$OpenApi = OpenApi::from(json_decode($json, true));

$OpenApi->components->schemas['pet']->description;
```

Publishing DataModels
---------------------

[](#publishing-datamodels)

You can directly import these files into your project like this:

```
./vendor/bin/data-model-openapi30 app/DataModelOpenapi30
```

Acceptance Tests
----------------

[](#acceptance-tests)

TestStatus[4.7.2.2 Info Object Example](https://spec.openapis.org/oas/v3.0.4.html#info-object-example)✅[4.7.3.2 Contact Object Example](https://spec.openapis.org/oas/v3.0.4.html#contact-object-example)✅[4.7.4.2 License Object Example](https://spec.openapis.org/oas/v3.0.4.html#license-object-example)✅[4.7.5.2 Server Object Example](https://spec.openapis.org/oas/v3.0.4.html#server-object-example)✅[4.7.7.2 Components Object Example](https://spec.openapis.org/oas/v3.0.4.html#components-object-example)✅[4.7.8.3 Paths Object Example](https://spec.openapis.org/oas/v3.0.4.html#paths-object-example)✅[4.7.9.2 Path Item Object Example](https://spec.openapis.org/oas/v3.0.4.html#path-item-object-example)✅[4.7.10.2 Operation Object Example](https://spec.openapis.org/oas/v3.0.4.html#operation-object-example)✅[4.7.11.2 External Documentation Object Example](https://spec.openapis.org/oas/v3.0.4.html#external-documentation-object-example)✅[4.7.12.5 Parameter Object Examples](https://spec.openapis.org/oas/v3.0.4.html#parameter-object-examples)✅[4.7.13.2 Request Body Examples](https://spec.openapis.org/oas/v3.0.4.html#request-body-examples)✅[4.7.14.2 Media Type Examples](https://spec.openapis.org/oas/v3.0.4.html#media-type-examples-0)✅Properties
----------

[](#properties)

[4.0 Specification](https://spec.openapis.org/oas/v3.0.4.html#specification)
============================================================================

[](#40-specification)

[4.7 Schema](https://spec.openapis.org/oas/v3.0.4.html#schema-0)
----------------------------------------------------------------

[](#47-schema)

This section describes the structure of the OpenAPI Description format

### [4.7.1 OpenAPI Object](https://spec.openapis.org/oas/v3.0.4.html#openapi-object)

[](#471-openapi-object)

This is the root object of the OpenAPI Description.

#### [4.7.1.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields)

[](#4711-fixed-fields)

Field NameTypeStatusopenapi[`string`](src/OpenApi.php)✅info[`Info Object`](src/Info.php)✅servers[`[Server Object]`](src/Server.php)✅paths[`Paths Object`](src/PathItem.php)✅components[`Components Object`](src/Components.php)✅security[`Security Requirement Object`](src/OpenApi.php)✅tags\[[`Tag Object`](src/Tag.php)\]✅externalDocs[`External Documentation Object`](src/ExternalDocumentation.php)✅### [4.7.2 Info Object](https://spec.openapis.org/oas/v3.0.4.html#info-object)

[](#472-info-object)

The object provides metadata about the API.

#### [4.7.2.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-0)

[](#4721-fixed-fields)

Field NameTypeStatustitle[`string`](src/Info.php)✅description[`string`](src/Info.php)✅termsOfService[`string`](src/Info.php)✅contact[`Contact Object`](src/Contact.php)✅license[`License Object`](src/License.php)✅version[`string`](src/Info.php)✅### [4.7.3 Contact Object](https://spec.openapis.org/oas/v3.0.4.html#contact-object)

[](#473-contact-object)

Contact information for the exposed API.

#### [4.7.3.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-1)

[](#4731-fixed-fields)

FieldTypeStatusname[`string`](src/Contact.php)✅url[`string`](src/Contact.php)✅email[`email`](src/Contact.php)✅### [4.7.4 License Object](https://spec.openapis.org/oas/v3.0.4.html#license-object)

[](#474-license-object)

License information for the exposed API.

#### [4.7.4.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-2)

[](#4741-fixed-fields)

FieldTypeStatusname[`string`](src/License.php)✅url[`string`](src/License.php)✅### [4.7.5 Server Object](https://spec.openapis.org/oas/v3.0.4.html#server-object)

[](#475-server-object)

An object representing a Server.

#### [4.7.5.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-3)

[](#4751-fixed-fields)

Field NameTypeStatusurl[`string`](src/Server.php)✅description[`string`](src/Server.php)✅variablesMap\[[`string`](src/Server.php), [`Server Variable Object`](src/ServerVariable.php)\]✅### [4.7.6 Server Object](https://spec.openapis.org/oas/v3.0.4.html#server-variable-object)

[](#476-server-object)

An object representing a Server Variable for server URL template substitution.

#### [4.7.6.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-4)

[](#4761-fixed-fields)

Field NameTypeStatusenum[\[`string`\]](src/ServerVariable.php)✅default[`string`](src/ServerVariable.php)✅description[`string`](src/ServerVariable.php)✅### [4.7.7 Components Object](https://spec.openapis.org/oas/v3.0.4.html#components-object)

[](#477-components-object)

Holds a set of reusable objects for different aspects of the OAS.

### [4.7.7.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-5)

[](#4771-fixed-fields)

Field NameTypeStatusschemasMap\[[`string`](src/Components.php), [`Schema Object`](src/Schema.php) | [`Reference Object`](src/Reference.php)\]✅responsesMap\[[`string`](src/Components.php), [`Response Object`](src/Response.php) | [`Reference Object`](src/Reference.php)\]✅parametersMap\[[`string`](src/Components.php), [`Parameter Object`](src/Parameter.php) | [`Reference Object`](src/Reference.php)\]✅examplesMap\[[`string`](src/Components.php), [`Example Object`](src/Example.php) | [`Reference Object`](src/Reference.php)\]✅requestBodiesMap\[[`string`](src/Components.php), [`Request Body Object`](src/RequestBody.php) | [`Reference Object`](src/Reference.php)\]✅headersMap\[[`string`](src/Components.php), [`Header Object`](src/Header.php) | [`Reference Object`](src/Reference.php)\]✅securitySchemesMap\[[`string`](src/Components.php), [`Security Scheme Object`](src/SecurityScheme.php) | [`Reference Object`](src/Reference.php)\]✅linksMap\[[`string`](src/Components.php), [`Link Object`](src/Link.php) | [`Reference Object`](src/Reference.php)\]✅callbacksMap\[[`string`](src/Components.php), [`Callback Object`](src/PathItem.php) | [`Reference Object`](src/Reference.php)\]✅### [4.7.8 Paths Object](https://spec.openapis.org/oas/v3.0.4.html#paths-object)

[](#478-paths-object)

Holds the relative paths to the individual endpoints and their operations.

#### [4.7.8.1 Patterned Fields](https://spec.openapis.org/oas/v3.0.4.html#patterned-fields)

[](#4781-patterned-fields)

Field NameTypeStatus/{path}[Path Item Object](src/PathItem.php)✅### [4.7.9 Path Item Object](https://spec.openapis.org/oas/v3.0.4.html#path-item-object)

[](#479-path-item-object)

Describes the operations available on a single path.

#### [4.7.9.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-6)

[](#4791-fixed-fields)

Field NameTypeStatus$ref[`string`](src/PathItem.php)✅summary[`string`](src/PathItem.php)✅description[`string`](src/PathItem.php)✅get[`Operation Object`](src/Operation.php)✅put[`Operation Object`](src/Operation.php)✅post[`Operation Object`](src/Operation.php)✅delete[`Operation Object`](src/Operation.php)✅options[`Operation Object`](src/Operation.php)✅head[`Operation Object`](src/Operation.php)✅patch[`Operation Object`](src/Operation.php)✅trace[`Operation Object`](src/Operation.php)✅servers[`Server Object`](src/Server.php)✅parameters\[[`Parameter Object`](src/Parameter.php) | [`Reference Object`](src/Reference.php)\]✅### [4.7.10 Operation Object](https://spec.openapis.org/oas/v3.0.4.html#operation-object)

[](#4710-operation-object)

Describes a single API operation on a path.

#### [4.7.10.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-7)

[](#47101-fixed-fields)

Field NameTypeStatustags[\[`string`\]](src/Operation.php)✅summary[`string`](src/Operation.php)✅description[`string`](src/Operation.php)✅externalDocs[`External Documentation Object`](src/ExternalDocumentation.php)✅operationId[`string`](src/Operation.php)✅parameters\[[`Parameter Object`](src/Parameter.php) | [`Reference Object`](src/Reference.php)\]✅requestBody[`Request Body Object`](src/RequestBody.php) | [`Reference Object`](src/Reference.php)✅responses[`Responses Object`](src/Response.php)✅callbacksMap\[[`string`](src/Operation.php), [`Callback Object`](src/PathItem.php) | [`Reference Object`](src/Reference.php)\]✅deprecated[`boolean`](src/Operation.php)✅security\[`Security Requirement Object`\]✅servers[\[`Server Object`\]](src/Server.php)✅### [4.7.11 External Documentation Object](https://spec.openapis.org/oas/v3.0.4.html#external-documentation-object)

[](#4711-external-documentation-object)

Allows referencing an external resource for extended documentation.

#### [4.7.11.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-8)

[](#47111-fixed-fields)

Field NameTypeStatusdescription[`string`](src/ExternalDocumentation.php)✅url[`string`](src/ExternalDocumentation.php)✅### [4.7.12 Parameter Object](https://spec.openapis.org/oas/v3.0.4.html#parameter-object)

[](#4712-parameter-object)

Describes a single operation parameter.

#### [4.7.12.2 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-9)

[](#47122-fixed-fields)

The rules for serialization of the parameter are specified in one of two ways. Parameter Objects *MUST* include either a `content` field or a `schema`field, but not both.

##### [4.7.12.2.1 Common Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#common-fixed-fields)

[](#471221-common-fixed-fields)

These fields *MAY* be used with either `content` or `schema`.

Field NameTypeStatusname[`string`](src/Parameter.php)✅in[`string`](src/Parameter.php)✅description[`string`](src/Parameter.php)✅required[`boolean`](src/Parameter.php)✅deprecated[`boolean`](src/Parameter.php)✅allowEmptyValue[\[`boolean`\]](src/Parameter.php)✅##### [4.7.12.2.2 Fixed Fields for use with `schema`](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-use-with-schema)

[](#471222-fixed-fields-for-use-with-schema)

For simpler scenarios, a `schema` and `style` can describe the structure and syntax of the parameter.

Field NameTypeStatusstyle[`string`](src/Parameter.php)✅explode[`boolean`](src/Parameter.php)✅allowReserved[`boolean`](src/Parameter.php)✅schema[`Schema Object`](src/Schema.php) | [`Reference Object`](src/Reference.php)✅example[Any](src/Schema.php)✅examplesMap\[ [`string`](src/Schema.php), [`Example Object`](src/Example.php) | [`Reference Object`](src/Reference.php)\]✅##### [4.7.12.2.3 Fixed Fields for use with `content`](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-use-with-content)

[](#471223-fixed-fields-for-use-with-content)

Field NameTypeStatuscontentMap\[[`string`](src/Schema.php), [`Media Type Object`](src/Schema.php)\]✅### [4.7.13 Request Body Object](https://spec.openapis.org/oas/v3.0.4.html#request-body-object)

[](#4713-request-body-object)

Describes a single request body.

#### [4.7.13.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-10)

[](#47131-fixed-fields)

Field NameTypeStatusdescription[`string`](src/RequestBody.php)✅contentMap\[[`string`](src/RequestBody.php), [`Media Type Object`](src/MediaType.php)\]✅required[`boolean`](src/RequestBody.php)✅### [4.7.14 Media Type Object](https://spec.openapis.org/oas/v3.0.4.html#media-type-object)

[](#4714-media-type-object)

Each Media Type Object provides schema and examples for the media type identified by its key.

#### [4.7.14.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-11)

[](#47141-fixed-fields)

Field NameTypeStatusschema[`Schema Object`](src/Schema.php) | [`Reference Object`](src/Reference.php)✅example[Any](src/MediaType.php)✅examplesMap\[[`string`](src/MediaType.php), [`Example Object`](src/Example.php) | [`Reference Object`](src/Reference.php)\]✅encodingMap\[[`string`](src/MediaType.php), [`Encoding Object`](src/Encoding.php)\]✅### [4.7.15 Encoding Object](https://spec.openapis.org/oas/v3.0.4.html#encoding-object)

[](#4715-encoding-object)

A single encoding definition applied to a single schema property.

#### [4.7.15.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-12)

[](#47151-fixed-fields)

##### [4.7.15.1.1 Common Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#common-fixed-fields-0)

[](#471511-common-fixed-fields)

These fields *MAY* be used either with or without the RFC6570-style serialization fields defined in the next section below.

Field NameTypeStatuscontentType[`string`](src/Encoding.php)✅headersMap\[[`string`](src/Encoding.php), [`Header Object`](src/Header.php) | [`Reference Object`](src/Reference.php)\]✅##### [4.7.15.1.2 Fixed Fields for RFC6570-style Serialization](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-rfc6570-style-serialization)

[](#471512-fixed-fields-for-rfc6570-style-serialization)

Field NameTypeStatusstyle[`string`](src/Encoding.php)✅explode[`boolean`](src/Encoding.php)✅allowReserved[`boolean`](src/Encoding.php)✅### [4.7.16 Responses Object](https://spec.openapis.org/oas/v3.0.4.html#responses-object)

[](#4716-responses-object)

A container for the expected responses of an operation. The container maps an HTTP response code to the expected response.

#### [4.7.16.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-13)

[](#47161-fixed-fields)

Field NameTypeStatusdefault[`Response Object`](src/Response.php) | [`Reference Object`](src/Reference.php)✅#### [4.7.16.2 Patterned Fields](https://spec.openapis.org/oas/v3.0.4.html#patterned-fields-0)

[](#47162-patterned-fields)

Field NameTypeStatusHTTP Status Code[`Response Object`](src/Response.php) | [`Reference Object`](src/Reference.php)✅### [4.7.17 Response Object](https://spec.openapis.org/oas/v3.0.4.html#response-object)

[](#4717-response-object)

Describes a single response from an API operation, including design-time, static links to operations based on the response.

#### [4.7.17.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-14)

[](#47171-fixed-fields)

Field NameTypeStatusdescription[`string`](src/Response.php)✅headersMap\[[`string`](src/Response.php), [Header Object](src/Header.php) | [Reference Object](src/Reference.php)\]✅contentMap\[[`string`](src/Response.php), [Media Type Object](src/Header.php)\]✅linksMap\[[`string`](src/Response.php), [Link Object](src/Link.php) | [Reference Object](src/Reference.php)\]✅### [4.7.19 Example Object](https://spec.openapis.org/oas/v3.0.4.html#example-object)

[](#4719-example-object)

An object grouping an internal or external example value with basic `summary` and `description` metadata.

#### [4.7.19.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-15)

[](#47191-fixed-fields)

Field NameTypeStatussummary[`string`](src/Example.php)✅description[`string`](src/Example.php)✅value[Any](src/Example.php)✅externalValue[`string`](src/Example.php)✅### [4.7.20 Link Object](https://spec.openapis.org/oas/v3.0.4.html#link-object)

[](#4720-link-object)

The Link Object represents a possible design-time link for a response.

#### [4.7.20.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-16)

[](#47201-fixed-fields)

Field NameTypeStatusoperationRef[`string`](src/Link.php)✅operationId[`string`](src/Link.php)✅parametersMap\[[`string`](src/Link.php), [Any](src/Link.php) | [{expression}](src/Link.php)\]✅requestBody[Any](src/Link.php) | [{expression}](src/Link.php)✅description[`string`](src/Link.php)✅server[`Server Object`](src/Server.php)✅### [4.7.21 Header Object](https://spec.openapis.org/oas/v3.0.4.html#header-object)

[](#4721-header-object)

Describes a single header for HTTP responses and for individual parts in multipart representations.

#### [4.7.21.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-17)

[](#47211-fixed-fields)

##### [4.7.21.1.1 Common Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#common-fixed-fields-1)

[](#472111-common-fixed-fields)

These fields *MAY* be used with either `content` or `schema`.

Field NameTypeStatusdescription[`string`](src/Header.php)✅required[`boolean`](src/Header.php)✅deprecated[`boolean`](src/Header.php)✅###### [4.7.21.1.2 Fixed Fields for use with `schema`](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-use-with-schema-0)

[](#472112-fixed-fields-for-use-with-schema)

For simpler scenarios, a schema and style can describe the structure and syntax of the header.

Field NameTypeStatusstyle[`string`](src/Header.php)✅explode[`boolean`](src/Header.php)✅schema[`Schema Object`](src/Schema.php) | [`Reference Object`](src/Reference.php)✅example[Any](src/Header.php)✅examplesMap\[[`string`](src/Header.php), [`Example Object`](src/Example.php) | [`Reference Object`](src/Reference.php)\]✅##### [4.7.21.1.3 Fixed Fields for use with `content`](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-for-use-with-content-0)

[](#472113-fixed-fields-for-use-with-content)

For more complex scenarios, the content field can define the media type and schema of the header, as well as give examples of its use.

Field NameTypeStatuscontentMap\[[`string`](src/Header.php), [`Media Type Object`](src/MediaType.php)\]✅### [4.7.22 Tag Object](https://spec.openapis.org/oas/v3.0.4.html#tag-object)

[](#4722-tag-object)

Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.

#### [4.7.22.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-18)

[](#47221-fixed-fields)

FieldTypeStatusname[`string`](src/Tag.php)✅description[`string`](src/Tag.php)✅description[`External Documentation Object`](src/ExternalDocumentation.php)✅### [4.7.23 Reference Object](https://spec.openapis.org/oas/v3.0.4.html#reference-object)

[](#4723-reference-object)

A simple object to allow referencing other components in the OpenAPI Description, internally and externally.

#### [4.7.23.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-19)

[](#47231-fixed-fields)

FieldTypeStatus$ref[`string`](src/Reference.php)✅### [4.7.24 Schema Object](https://spec.openapis.org/oas/v3.0.4.html#schema-object)

[](#4724-schema-object)

The Schema Object allows the definition of input and output data types.

#### [4.7.24.1 JSON Schema Keywords](https://spec.openapis.org/oas/v3.0.4.html#json-schema-keywords)

[](#47241-json-schema-keywords)

Field NameTypeStatustitle[`string`](src/Schema.php)✅multipleOf[`number`](src/Schema.php)✅maximum[`number`](src/Schema.php)✅exclusiveMaximum[`boolean`](src/Schema.php)✅minimum[`number`](src/Schema.php)✅exclusiveMinimum[`boolean`](src/Schema.php)✅maxLength[`integer`](src/Schema.php)✅minLength[`integer`](src/Schema.php)✅pattern[`string`](src/Schema.php)✅maxItems[`integer`](src/Schema.php)✅minItems[`integer`](src/Schema.php)✅uniqueItems[`boolean`](src/Schema.php)✅maxProperties[`integer`](src/Schema.php)✅minProperties[`integer`](src/Schema.php)✅required[`array`](src/Schema.php)✅enum[`array`](src/Schema.php)✅type[`string`](src/Schema.php)✅allOf[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅oneOf[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅anyOf[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅not[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅items[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅properties[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅additionalProperties[`boolean`](src/Reference.php) |[`Reference Object`](src/Reference.php) | [`Schema Object`](src/Schema.php)✅description[`string`](src/Schema.php)✅format[`string`](src/Schema.php)✅format[`Any`](src/Schema.php)✅#### [4.7.24.2 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-20)

[](#47242-fixed-fields)

Field NameTypeStatusnullable[`boolean`](src/Schema.php)✅discriminator`Discriminator Object`✅readOnly[`boolean`](src/Schema.php)✅writeOnly[`boolean`](src/Schema.php)✅xml[`XML Object`](src/Xml.php)✅externalDocs[`External Documentation Object`](src/ExternalDocumentation.php)✅example[Any](src/Schema.php)✅deprecated[`boolean`](src/Schema.php)✅### [4.7.25 Discriminator Object](https://spec.openapis.org/oas/v3.0.4.html#discriminator-object)

[](#4725-discriminator-object)

When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object gives a hint about the expected schema of the document.

#### [4.7.25.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-21)

[](#47251-fixed-fields)

Field NameTypeStatuspropertyName[`string`](src/Discriminator.php)✅mappingMap\[[`string`](src/Discriminator.php), `string`\]✅### [4.7.26 XML Object](https://spec.openapis.org/oas/v3.0.4.html#xml-object)

[](#4726-xml-object)

A metadata object that allows for more fine-tuned XML model definitions.

#### [4.7.26.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22)

[](#47261-fixed-fields)

Field NameTypeStatusname[`string`](src/Xml.php)✅namespace[`string`](src/Xml.php)✅prefix[`string`](src/Xml.php)✅attribute[`boolean`](src/Xml.php)✅wrapped[`boolean`](src/Xml.php)✅### [4.7.27 Security Scheme Object](https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object-0)

[](#4727-security-scheme-object)

Defines a security scheme that can be used by the operations.

#### [4.7.27.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-23)

[](#47271-fixed-fields)

Field NameTypeStatustype[`string`](src/SecurityScheme.php)✅description[`string`](src/SecurityScheme.php)✅name[`string`](src/SecurityScheme.php)✅in[`string`](src/SecurityScheme.php)✅scheme[`string`](src/SecurityScheme.php)✅bearerFormat[`string`](src/SecurityScheme.php)✅flows[`string`](src/OAuthFlows.php)✅openIdConnectUrl[`string`](src/SecurityScheme.php)✅### [4.7.28 OAuth Flows Object](https://spec.openapis.org/oas/v3.0.4.html#oauth-flows-object)

[](#4728-oauth-flows-object)

Allows configuration of the supported OAuth Flows.

#### [4.7.28.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-24)

[](#47281-fixed-fields)

Field NameTypeStatusimplicit[`OAuth Flow Object`](src/OAuthFlow.php)✅password[`OAuth Flow Object`](src/OAuthFlow.php)✅clientCredentials[`OAuth Flow Object`](src/OAuthFlow.php)✅authorizationCode[`OAuth Flow Object`](src/OAuthFlow.php)✅### [4.7.29 OAuth Flow Object](https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object-0)

[](#4729-oauth-flow-object)

Defines a security scheme that can be used by the operations.

#### [4.7.29.1 Fixed Fields](https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-25)

[](#47291-fixed-fields)

Field NameTypeStatusauthorizationUrl[`string`](src/OAuthFlow.php)✅tokenUrl[`string`](src/OAuthFlow.php)✅refreshUrl[`string`](src/OAuthFlow.php)✅scopesMap\[[`string`](src/OAuthFlow.php), [`string`](src/OAuthFlow.php)\]✅Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/data-model-openapi30/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance59

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~57 days

Total

16

Last Release

259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

openapiopenapi3phpzero-to-prodDataModelAdapterOpenApi30data-model-openapi30

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-data-model-openapi30/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-data-model-openapi30/health.svg)](https://phpackages.com/packages/zero-to-prod-data-model-openapi30)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
