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

docs: parameters documentation #1932

Merged
merged 1 commit into from
May 6, 2024
Merged

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Mar 29, 2024

No description provided.

@GwendolenLynch
Copy link
Contributor

Thanks so much for your help lately, and for this Parameter work.

This all reads well for me, with two comments.

It might be worth adding a note/example specifically relative to JSON:API's include parameter. For example, when testing the beta I was using this to have the parameter show up in Swagger UI, et al:

#[GetCollection(
    parameters: ['include' => new QueryParameter(description: 'Included relationship paths, comma separated')],
)]
#[Get(
    parameters: ['include' => new QueryParameter(description: 'Included relationship paths, comma separated')],
)]

The other thing is with documentation the very long constructors are really hard to read. Can they be one property per-line to better communicate to the developer what they need to "pull in", or not?

@soyuka
Copy link
Member Author

soyuka commented Apr 3, 2024

@GwendolenLynch you should be able to create a parameter with default values and use it as attribute right?

class IncludeParameter extends QueryParameter {
    public function __construct(...) {
        parent::__construct(description: 'my very long descr');
    }
}

@GwendolenLynch
Copy link
Contributor

Ha! I didn't even think of trying something like that yet. I am liking this new feature more and more than I already did!

@soyuka soyuka changed the base branch from main to 3.3 April 29, 2024 13:56
@soyuka soyuka merged commit 1f930d1 into api-platform:3.3 May 6, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants