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

feat(codegen): Add JSON Schema to CTO utility #297

Merged
merged 2 commits into from
Jul 10, 2021

Conversation

mttrbrts
Copy link
Member

@mttrbrts mttrbrts commented Jul 9, 2021

Closes #294

This PR adds support for Concerto model generation from a small subset of JSON Schema.

Changes

  • Adds a new CodeGen module in the style of the JSON document inference utility.
  • Includes support for top-level schema definitions
  • Includes support for primitive types, date-time formats and objects with properties.

Flags

  • This feature is implemented using string manipulation to create the model. It would be greatly improved through the use of an Update API #293. This would also allow us to better handle sub-schemas.
  • This feature should be considered experimental, as such I do not propose to document this publicly or add it to the Concerto CLI yet.
  • Requires further unit test for exception paths to satisfy code-coverage requirements

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to master from fork:branchname

@mttrbrts mttrbrts requested a review from dselman July 9, 2021 13:09
Copy link
Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. We should be able to infer string regex and number range constraints as well?

@mttrbrts mttrbrts merged commit 3cd19ca into accordproject:master Jul 10, 2021
@mttrbrts mttrbrts deleted the mr-jsonToCto branch July 10, 2021 12:47
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.

Model generation from JSONSchema definition
2 participants