Open Swahjak opened 4 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
I have the same issue, I can't change the property name because it's defined by wordpress. It happens when I use typescript-axios generator. typescript-fetch is ok, but it does not support nodejs so I have to use typescript-axios.
Same here :/ with typescript-angular. Very annoying while I'm using TS Lint. I use a bash script after generate command as a workaround:
find ./build/openapi -type f -exec sed -i '' -e '' -e "s/hydramember/['hydra:member']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e '' -e "s/hydratotalItems/['hydra:totalItems']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydraview/['hydra:view']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydrasearch/['hydra:search']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydratemplate/['hydra:template']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydravariableRepresentation/['hydra:variableRepresentation']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydramapping/['hydra:mapping']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydrafirst/['hydra:first']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydralast/['hydra:last']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydranext/['hydra:next']/g" {} \; find ./build/openapi -type f -exec sed -i '' -e "s/hydraprevious/['hydra:previous']/g" {} \;
Same
Is there any update on this? I am now also using a script that replaces the names as a workaround, but this is very tedious...
Is there any update on this? I am now also using a script that replaces the names as a workaround, but this is very tedious...
https://github.com/OpenAPITools/openapi-generator/issues/13999#issuecomment-1507092014
Bug Report Checklist
Description
Original issue https://github.com/OpenAPITools/openapi-generator/issues/1080. Was addressed in https://github.com/OpenAPITools/openapi-generator/pull/1152 but seems to have been 'undone' in https://github.com/OpenAPITools/openapi-generator/commit/ced6e0502ec53031efa0a043924f7fe7e4b2691e#diff-328108658e03bbcf6cc8b931ffa7a63e (by only allowing alphanumeric characters).
When generating from openapi documentation that contains colons the typescript generator will remove these colons. The specific case is generating a schema that's build using https://www.hydra-cg.com/spec/latest/core/.
openapi-generator version
4.3.1, not a regression (although it was fixed, it seems to have been 'undone' before reaching a release).
OpenAPI declaration file content or url
Schema:
Response example:
Generated typescript:
Command line used for generation
java -jar openapi-generator-cli.jar generate -i schema.json -g typescript-angular -o ./api
Steps to reproduce
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/1080 https://github.com/OpenAPITools/openapi-generator/pull/1152 https://github.com/OpenAPITools/openapi-generator/commit/ced6e0502ec53031efa0a043924f7fe7e4b2691e#diff-328108658e03bbcf6cc8b931ffa7a63e (https://github.com/api-platform/api-platform/issues/1493)
Suggest a fix