hauke96 / json2code Goto Github PK
View Code? Open in Web Editor NEWA simple converter to turn json into classes
License: GNU General Public License v3.0
A simple converter to turn json into classes
License: GNU General Public License v3.0
Raise errors, when something is not correct during parsing. Some situations where this might be useful:
Throwing error and exit program:
properties
/name
objectcollection
is missing)Printing warning but still go on:
name
)Also put the line into the error-message
Add a comment in every file that this class/enum/struct/file/... is generated and that changes will be removed after re-generating.
Add enum support. To create a good structure, rename the "schemes" root element into "classes" and add "enums" next to it. This scheme structure should do the trick:
{
"classes": [...],
"enums":
[
{
"name": "TestEnum",
"fields":
[
"ACTIVE",
"DEACTIVE",
"UNDEFINED"
]
}
]
}
This does not match the applications name of json2code
but would really nice for existing projects which want to move to json2code
but already have e.g. Java classes.
Add support for the two types of inheritance: Type- and implementation-inheritance.
For type inheritance add the keyword "inherits": "SomeOtherClass"
. This will create actual inheritance in the code (as far as it is supported) which will produce this kind of json when transmitted:
"field": "value",
"otherField": "otherValue",
"SomeOtherClass":
{
"someOtherField": 123
}
For implementation inheritance add the keyword "embed": "SomeOtherClass"
. The generated code will then produce this kind of transmitted json:
"field": "value",
"otherField": "otherValue",
"someOtherField": 123
It simply embeds the field of SomeOtherClass
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.