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

Use of default PHP property values as default/example property values #1709

Open
DusanKasan opened this issue Aug 27, 2020 · 1 comment
Open

Comments

@DusanKasan
Copy link

Hi, is it possible for the default property values in PHP to be used as default and/or example values in the produced swagger definitions? What I mean is if you have a model of:

class BankAccount
{
    public string $status = "open";
}

Is it possible for the produced documentation to show that the default and/or example value of the status field to be "open"? Didn't find it in the docs, so sorry if this was already answered. Thanks for the help!

@GuilhemN
Copy link
Collaborator

This isn't supported currently but it would be a nice feature!

We could use the method ReflectionClass::getDefaultProperties(), inside a new processor (here).
Would you like to contribute this change?

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

No branches or pull requests

3 participants