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

Fixed error when building from schema with complex model properties #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mamonth
Copy link

@mamonth mamonth commented May 4, 2022

Changes needed to support properties like 'some:property' widely used in API design. See HAL format for example.

@karlvr
Copy link
Owner

karlvr commented May 6, 2022

@mamonth thank you very much for this PR! I would love to only emit these quotes if they're needed... I wonder about adding a new Handlebars helper that could do that... is it a kind of quoteIdentifier? Interesting to think... TypeScript lets you do that but Java doesn't. We can add language-specific helpers, e.g. in typescript-common in the exportTemplates method.

Maybe it's quoteIdentifierIfNeeded and it looks for any characters in the serialised name that aren't legal and then quotes it. I guess it then also escapes quotes themselves using the escapeString function already in typescript-common.

Are you happy to try out these changes?

@karlvr
Copy link
Owner

karlvr commented May 7, 2022

@mamonth also could you please add a sample .yml test case that demonstrates the issue? That will then test it with all of the generators.

@mamonth
Copy link
Author

mamonth commented May 7, 2022

Language specific helper seems like valid option. I wasn't able to dive in to architecture of generators deep enough to see this possibility.
And good point about test case.
I'll try to make it right :)

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

Successfully merging this pull request may close these issues.

2 participants