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

Throw and exception when inferring from JSON Schema and the resulting Concerto is about to include reserved keywords #48

Closed
stefanblaginov opened this issue Aug 7, 2023 · 4 comments · Fixed by #100
Assignees
Labels
good first issue Good for newcomers

Comments

@stefanblaginov
Copy link
Contributor

stefanblaginov commented Aug 7, 2023

Context

Concerto has a number of reserved words that cannot be used in a valid Concerto file. Currently the JSON Schema inference code lets us create a Concerto file with these reserved words.

That should not be the case and and error must be thrown that an invalid file is about be created.

@stefanblaginov stefanblaginov added the good first issue Good for newcomers label Aug 7, 2023
@kailash360
Copy link
Contributor

kailash360 commented Mar 5, 2024

@stefanblaginov @sanketshevkar

Can I take up this issue?

@sanketshevkar
Copy link
Member

Yep sure!

@kailash360
Copy link
Contributor

kailash360 commented Mar 7, 2024

Since we already have the list of available reserved words, we can check if the current field is a part of the list or not. However, I have small doubt if we should check for these words without the $ symbol as well. For example, if $timestamp is a reserved word then user obviously cannot use $timestamp in the concerto file, but whether the user can use timestamp field or not.

@sanketshevkar @dselman can you please confirm on this?

@sanketshevkar
Copy link
Member

Since we already have the list of available reserved words, we can check if the current field is a part of the list or not. However, I have small doubt if we should check for these words without the $ symbol as well. For example, if $timestamp is a reserved word then user obviously cannot use $timestamp in the concerto file, but whether the user can use timestamp field or not.

I believe $ is added so as to let users know its a reserved keyword. We would like to name our variables like $class or __prototype__ (in JS), so that someone won't accidently use them. @dselman is that correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants