-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support convert uniqueItems, minItems and maxItems keywords in …
…json schema
- Loading branch information
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
This file was generated by the KCL auto-gen tool. DO NOT EDIT. | ||
Editing this file might prove futile when you re-run the KCL auto-gen generate command. | ||
""" | ||
|
||
schema Book: | ||
""" | ||
Book | ||
|
||
Attributes | ||
---------- | ||
title : str, optional | ||
authors : [str], optional | ||
""" | ||
|
||
title?: str | ||
authors?: [str] | ||
|
||
check: | ||
len(authors) <= 5 | ||
len(authors) >= 1 | ||
isunique(authors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://example.com/schemas/book.json", | ||
"type": "object", | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"authors": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1, | ||
"maxItems": 5, | ||
"uniqueItems": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters