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
Schemas that have a name with a '-' character in them cause invalid code to be generated #83
Comments
Thank you for opening an issue. If you don't need the schemas you can pass false to the generate schema option. This was an issue with @hey-api/openapi-ts. We will need to update. They have changed many APIs in the meantime, may take some time. |
Thanks for taking a look at this so quickly! I was planning on working around this by changing my backend openapi generation -- but I figured it would be good to get the bug report in. Sorry, but how do you disable schema generation? It doesn't seem to be an option in the cli invocation? |
Sorry seems, we didn't expose that option. |
faced the same issue for e.g. |
- Update to the latest `@hey-api/openapi-ts` version `0.42.1` - Fixed a bug where types in mutation hooks were imported from a (non-relative) direct file import. - This is the same fix implemented in #61, which was done for query hooks. - Fixed a bug where JSDocs were not being added to generated hooks. - Add more unit tests Fixes: #83 Enables work towards: #81
- Update to the latest `@hey-api/openapi-ts` version `0.42.1` - fixes: #83, - Enables work towards #81 - Fixed a bug where types in mutation hooks were imported from a (non-relative) direct file import. - This is the same fix implemented in #61, which was done for query hooks. - Expand the match regex to take account of non-alphabetical file paths - fixes: #85 - Fixed a bug where JSDocs were not being added to generated hooks. - Add more unit testing
This was fixed in 1.2.0 |
works now for me - updated yesterday 💯 |
eg:
Will generate code that looks like this:
Dashes are not valid characters for javascript variable names, but are valid strings for json keys.
Not sure the best way to deal with this, maybe export an object instead, mangle to a _ or just explicitly not support having - in schema names and add a test for that.
The text was updated successfully, but these errors were encountered: