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

Argument #2 ($schema) must be of type cebe\openapi\spec\Schema #24

Open
colinmollenhour opened this issue Apr 17, 2024 · 1 comment
Open

Comments

@colinmollenhour
Copy link

I tried to give the new DTO feature a spin and ran into an issue:

In DtoGenerator.php line 35:

  Crescat\SaloonSdkGenerator\Generators\DtoGenerator::generateDtoClass(): Argument #2 ($schema) must be of type cebe\openapi\spec\Schema, cebe\openap
  i\spec\Reference given, called in phar:///app/vendor/crescat-io/saloon-sdk-generator/builds/sdkgenerator/src/Generators/DtoGenerator.php on line 28


Script sdkgenerator generate:sdk merged.json --type=openapi --name="SaloonConnector" --output=src --namespace=ShipStream\\FedEx --force handling the generate-sdk event returned with error code 1

Let me know if you'd like to take a look at the repo but basically all it does is merge multiple OpenAPI specs into merged.json, apply some sanitization to the spec (e.g. adding tags) then run the sdkgenerator. It worked on version 1.10.0 but does not work on 1.2.0.

Side note: When using "composer require" the default version installed is 1.10, not 1.2 since 1.10 is "newer".. Took me a while to figure out why I wasn't seeing any DTO generated.. :)

@colinmollenhour
Copy link
Author

Ahh it appears that the DTO feature just doesn't support oneOf or allOf or $ref or some combination of them..

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

1 participant