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: support more keywords when generating from json schema #131

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

jakezhu9
Copy link
Contributor

@jakezhu9 jakezhu9 commented Aug 8, 2023

1. Does this PR affect any open issues?(Y/N) and add issue references

  • N
  • Y

part of kcl-lang/kcl#526

2. What is the scope of this PR (e.g. component or file name):

pkg/tools/gen

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

Support convert const, $ref, $defs and additionalProperties keywords from json schema to kcl schema.
Add getSortedKeys function for more ordered and stable results.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@coveralls
Copy link

coveralls commented Aug 8, 2023

Pull Request Test Coverage Report for Build 5794201689

  • 48 of 52 (92.31%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 59.662%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/tools/gen/genkcl_jsonschema.go 33 37 89.19%
Totals Coverage Status
Change from base Build 5781327883: 0.5%
Covered Lines: 2013
Relevant Lines: 3374

💛 - Coveralls


name?: str
socket?: Socket = {"HTTP": 80, "HTTPS": 443}
[...str]: any
Copy link
Contributor

Choose a reason for hiding this comment

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

if the index signature [...str]: any here will still be retained?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

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

Good Job! LGTM

@Peefy Peefy merged commit bed563c into kcl-lang:main Aug 8, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants