-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
additional-properties serialization example/documentation #25
Comments
Please open an issue in https://github.com/OpenAPITools/openapi-generator instead as your question is about the underlying JAR (openapi-generator-cli.jar) instead of this wrapper. |
Yes please. We welcome that. |
Thanks for this example. I was beginning to get a bit frustrated that I couldn't get it working, but you saved me! |
Yeah it took quite a while to find the configuration it wanted. I just put out a pr that updates the base readme so hopefully others discover the correct syntax faster than you and I. |
Please also see the new configuration file. It will handle that topic carefully for u. |
Adding additional properties with : --additional-properties=ngVersion=6.1.7,npmName=restClient didn't work for me. Adding quotes after the '=' sign and at the end made it work again. So now it looks like this |
Thanks BobbyLarone, this was my problem too. Usage page doesn't mention this requirement. |
I am looking for (and am willing to make a PR) documenting the correct way to submit multiple additional properties to
@openapitools/openapi-generator-cli
from an npm script.The example in the readme for using
additional-properties
only illustrates using a single property.Could I get an example of an array of additional properties being used?
I will be happy to make a pr enhancing the example in the readme once I know what is required.
I would like to pass multiple properties defined in my generator type.
Examples of serialization issues experienced:
"my-awesome-script-name": "openapi-generator generate -i docs/openapi.yaml -g typescript-angular -o generated-sources/openapi --additional-properties="ngVersion=6.1.7 npmName=restClient supportsES6=true npmVersion=6.9.0 withInterfaces=true"
Results in:
Could someone post an example of what
additional-properties
is expecting here?Additional info:
The java tests around this seem to be expecting a map:
https://github.com/OpenAPITools/openapi-generator/blob/046db19a8590f3557ae1e04be75792bbeb39cb69/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypescriptAngularAdditionalPropertiesIntegrationTest.java#L36
List of keys we should be able to access from additional-properties:
https://openapi-generator.tech/docs/generators/typescript-angular
I have also tried using
-p
instead of--additional-properties
as per the docs and got the same results above.Edit: It appears the whitespace is important for the additional-properties keys.
This works for me:
I can make a pr that adds an example like this to the readme, that will hopefully save other developers a few hours of debugging.
The text was updated successfully, but these errors were encountered: