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

[Question]: Is there a way to override the documentation for a specific class/type? #2281

Open
mousetail opened this issue Apr 25, 2024 · 1 comment
Labels

Comments

@mousetail
Copy link

Version

4.26

Question

Some of my models involve UUIDs (Symfony/Component/UUID).

Right now it generates the following documentation for it:

{
    "schemas": {
       "Uuid": {
           "type": "object"
        }
    }
}

This is not helpful because it doesn't tell the user the actual expected format.

So I tried to fix by adding this to the config:

schemas:
    Uuid:
       type: string
       format: uuid

But this created the following JSON:

{
    "schemas": {
       "Uuid": {
           "type": "string",
           "format": "uuid",
       }
       "Uuid2": {
           "type": "object"
        }
    }
}

And all my models now refer to Uuid2

Is there a way I can override the UUID type to use my preferred schema? There are a number of other types from different libraries that are also generating unhelpful schemas that I'd like to override.

Additional context

No response

@deluxetom
Copy link
Contributor

@mousetail in your doctrine entities, you can use the OA\Property attribute and set those to string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants