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

Invalid type given as required for multiple methods #1425

Open
AJenbo opened this issue Feb 20, 2025 · 10 comments
Open

Invalid type given as required for multiple methods #1425

AJenbo opened this issue Feb 20, 2025 · 10 comments

Comments

@AJenbo
Copy link
Contributor

AJenbo commented Feb 20, 2025

* refresh: enum, // If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.

enum is not a valid PHP type, the correct type for a generic enum is \UnitEnum, you probably just want string.

number is not a valid type, the correct one is numeric if you want int|float|numeric-string.

list is used for comma-separated lists, this should be string, but comment might be misleading as it appears it might accept both, in which case string|list would be better.

long is not a valid type, use int

time is not a valid type, use \DateTime, int or string

@AJenbo AJenbo changed the title Invalid type enum given as required for multiple methods Invalid type given as required for multiple methods Feb 20, 2025
@MidnightDesign
Copy link

This has been a issue for almost 2 years, but nobody is responding.

@AJenbo
Copy link
Contributor Author

AJenbo commented Mar 3, 2025

This has been a issue for almost 2 years, but nobody is responding.

Have you figured out what is used to generate the code?

@MidnightDesign
Copy link

I think had found it at some point, but I don't know right now.

@momala454
Copy link

https://github.com/elastic/elasticsearch/blob/113f0c17cc48913225d5c9e4e06ebb44a3a56e14/rest-api-spec/src/main/resources/rest-api-spec/api/_common.json#L28

this contains the comment and "type" in all of those json files, so maybe changing here to like list|string instead of list may work. I don't know where it's generated, or how to change it to optional

@AJenbo
Copy link
Contributor Author

AJenbo commented Mar 17, 2025

I was unable to figure out what they use to generate the code.

@ezimuel
Copy link
Contributor

ezimuel commented Mar 17, 2025

@AJenbo, @momala454, @MidnightDesign the code generator is not part of this repository. I'm working to fix the PHPStan issues and I'll let you know asap. Thanks for your patience.

@AJenbo
Copy link
Contributor Author

AJenbo commented Mar 17, 2025

... right, but what repo is it in?

@MidnightDesign
Copy link

@ezimuel Thank you for the response. I am aware that it's not here. Where is it?

@AJenbo
Copy link
Contributor Author

AJenbo commented Mar 17, 2025

For completeness he clarified that the generator is not publicly avalible.

@ezimuel
Copy link
Contributor

ezimuel commented Mar 18, 2025

I added a CONTRIBUTING guide where I explained the @generated tag. I hope this will help with future contributions. Thanks for your feedback.

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

No branches or pull requests

4 participants