Skip to content

Commit

Permalink
Merge pull request #122 from Peefy/update-jsonschema-module
Browse files Browse the repository at this point in the history
chore: update the jsonschema module
  • Loading branch information
Peefy authored Mar 14, 2024
2 parents dd14b25 + 8d808e6 commit 3fa7815
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jsonschema/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "jsonschema"
version = "0.0.4"
version = "0.0.5"
description = "`jsonschema` is a module for the JSON schema definition using KCL"

5 changes: 1 addition & 4 deletions jsonschema/ty.k
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
type JSONSchemaType = 'string' | 'number' | 'integer' | 'bool' | 'null' | 'array' | 'object'

schema JSONSchema:
[n: ...str]: str
id?: str
"$id"?: str
"$schema"?: str
"$ref"?: str
type?: JSONSchemaType | JSONSchemaType[]
title?: str
default?: any
Expand Down Expand Up @@ -84,9 +84,6 @@ schema JSONSchema:
allowComments?: bool
allowTrailingCommas?: bool

check:
n in ["$id", "$schema", "$ref"], "additional attributes must be in $id and $schema"

schema JSONSchemaMap:
[name: str]: JSONSchema

Expand Down
1 change: 1 addition & 0 deletions jsonschema/ty_test.k
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ test_jsonschema = lambda {
"$schema" = "https://json-schema.org/draft/2020-12/schema"
"$id" = "https://myid"
}
assert json_schema["$id"] == "https://myid"
}

0 comments on commit 3fa7815

Please sign in to comment.