Skip to content

Doc comments + GET query params #93

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

Merged
merged 9 commits into from
Mar 6, 2024
Merged

Doc comments + GET query params #93

merged 9 commits into from
Mar 6, 2024

Conversation

Menkveld-24
Copy link
Contributor

Hi.
I had this bit of code for my own project and was wondering what might be of use to merge into your main repository.
I added so that if you have a request scheme for a get request that it'd show up as query parameters instead of at the body.
I also added that comments above the functions/route handlers in controllers we're added as 'documentation' to the postman route (useful for sharing the api documentation internally with colleagues e.g.).
Haven't written any tests for this. I'll refine this along with tests if you think any of these 2 features is useful.

Kind regards,
Menke

Scherm­afbeelding 2024-01-28 om 15 27 39
The query params on a get request.

Scherm­afbeelding 2024-01-28 om 15 28 07
The documentation (comment above the function)

@andreaselia
Copy link
Owner

andreaselia commented Jan 29, 2024

This is an interesting idea, thanks for sharing it with us and everyone else who uses the package!

@tomirons what do you think mate? There are a few minor things I'd change like renaming include_doccomments to include_doc_comments for readability, but overall I think it looks good?

Copy link
Collaborator

@tomirons tomirons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the concept of this feature.

For this to be merged, some tests will need to be written.

@Menkveld-24
Copy link
Contributor Author

I've added some tests for the get request as well as the doc comment generation.
However, I stumbled upon deprecation of the Illuminate/Contracts/Validation/Rule used in the UppercaseRule. (https://laravel.com/api/10.x/Illuminate/Contracts/Validation/Rule.html) I think it's been replaced by the Illuminate/Contracts/Validation/ValidationRule. I left the check for the deprecated rule in there to not break it with the Rule.
Also phpunit kept complaining about the xml file and that it wanted me to run './vendor/bin/phpunit --migrate-configuration'
Also; there's still an error in the tests with the cache which i've been unable to resolve
Scherm­afbeelding 2024-02-01 om 20 33 46

@andreaselia
Copy link
Owner

Great updates, thank you @Menkveld-24!

I've been running into that issue too, it used to show up locally but not when running GitHub actions, so not sure what that's about. cc @tomirons 🤔

StyleCI appears to be failing but that's quite minor.

@Menkveld-24 Menkveld-24 marked this pull request as ready for review February 3, 2024 18:08
@Menkveld-24 Menkveld-24 requested a review from tomirons February 21, 2024 11:03
@tomirons tomirons merged commit 2cbc360 into andreaselia:master Mar 6, 2024
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.

3 participants