Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define multiple types for a property #1257

Open
gmeister2 opened this issue Jun 4, 2022 · 1 comment
Open

Define multiple types for a property #1257

gmeister2 opened this issue Jun 4, 2022 · 1 comment
Labels
enhancement type handling Type handling / mapping

Comments

@gmeister2
Copy link

version: 4.4.4
openapi: 3.1.0

The following Attribute code (property with mixed type: string|null):

new OA\Property(
    property: 'module',
    type: 'string',
    nullable: true,
),

Gives this json result:

"module": {
    "type": [
        "string",
        "null"
    ],
},

How would I setup the Attribute code to achive this json result (property with mixed type: string|float):

"module": {
    "type": [
        "string",
        "float"
    ],
},
@Tobion
Copy link
Contributor

Tobion commented Dec 28, 2022

This problem is part of #885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type handling Type handling / mapping
Projects
None yet
Development

No branches or pull requests

3 participants