-
Notifications
You must be signed in to change notification settings - Fork 940
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
adding attribute examples #1699
base: master
Are you sure you want to change the base?
adding attribute examples #1699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! Could you just please rename the files to something more meaningful? For example server_xx.php
@DerManoMann
Please let me know if my understanding is incorrect. 🙏 |
My bad - yes, this is fine. |
@@ -0,0 +1,18 @@ | |||
<?php | |||
|
|||
use OpenApi\Attributes as OAT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other docs all use as OA, while here it's as OAT. If you imported OpenApi\Attributes\Tag as OAT;
I would get where the T is coming from, but here it might be wrong and could lead to confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do that actually everywhere in the codebase to distinguish annotations from attributes.
Very useful for slow migration where you might use both at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well nvm then, seems like halfway through the user guide it sometimes switches to OAT. Cookbook even has both right after another:
https://zircote.github.io/swagger-php/guide/cookbook.html#mostly-virtual-models
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, people seem to use both, but it would be good to settle on a consistent pattern in the docs, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should make another PR converting OpenApi\Attributes as OA;
to OpenApi\Attributes as OAT;
or fix my PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fix the PR. You can add more if you want to, too.
there could be more example codes...