Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Existing DSL for JSON Schema? #51

Closed
chris-hailstorm opened this issue Jan 2, 2018 · 4 comments
Closed

Existing DSL for JSON Schema? #51

chris-hailstorm opened this issue Jan 2, 2018 · 4 comments

Comments

@chris-hailstorm
Copy link

Textx is an outstanding tool, thank you.

Is anyone aware of a JSON Schema implementation in Textx?

@igordejanovic
Copy link
Member

I'm not aware of any project using textX for JSON Schema implementation.
It shouldn't be hard to define grammar for JSON Schema in textX. You can start with JSON example.
Actually, JSON schema is JSON file so it can be parsed with any JSON parser (even textX JSON example) and validated and analysed afterwards. You could then extract schema validation rules and apply them to subsequent JSON files. JSON schema is meta-language, thus it could be applied to itself.

But, if you want standard JSON Schema implementation there are solution for Python that do that well and probably will parse much faster than textX. textX is perfect for situation where you want to parse something that doesn't have readily available parser, like some custom textual formats or DSLs.
Is there any specific reason not to use existing JSON Schema libs?

@chris-hailstorm
Copy link
Author

chris-hailstorm commented Jan 5, 2018 via email

@igordejanovic
Copy link
Member

Sounds interesting. Give it a try if you wish and post here if you get stuck along the way.
I'll be happy to help.

@goto40
Copy link
Member

goto40 commented Jun 9, 2018

You can easily reference an arbitrary non textX object (e. g., from a json model) from a textX model. Maybe have a look at https://github.com/igordejanovic/textX/blob/master/tests/functional/test_scoping/test_reference_to_nontextx_attribute.py

@textX textX locked and limited conversation to collaborators Oct 14, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants