json2jsii icon indicating copy to clipboard operation
json2jsii copied to clipboard

Generates jsii-compatible structs from JSON schemas

Results 9 json2jsii issues
Sort by recently updated
recently updated
newest added

Some schemas contain property names like `kubernetes/io`, which have been re-used as is, e.g. `readonly kubernetes/io: string;`. This patch converts the slashes to underscores, so that the usual camel-case conversion...

Currently code generation fails if there is a nested local reference present. Here is where the error is thrown: https://github.com/cdklabs/json2jsii/blob/main/src/type-generator.ts#L543-L557 Here is an example of schema that fails with this:...

p2

Currently code generation for some schemas is failing due to `ref` not starting with `#/definitions/`. Here is where the error is being thrown: https://github.com/cdklabs/json2jsii/blob/main/src/type-generator.ts#L514-L518 Here are some examples of schemas...

p2

Given the following snippet from a JSON Schema: ```json { "shell": { "anyOf": [ { "type": "string" }, { "type": "string", "enum": ["bash", "pwsh", "python", "sh", "cmd", "powershell"] } ]...

p2

Right now only primitive types are supported as unions. What would support for interfaces look like? https://github.com/cdklabs/json2jsii/blob/b6091c8d9d33a200f03811a8e819cc600c78c5b5/src/type-generator.ts#L576-L578 https://github.com/cdklabs/json2jsii/blob/b6091c8d9d33a200f03811a8e819cc600c78c5b5/src/type-generator.ts#L350-L352

p2

Could you please document the limitations of this tool as far as what subset of JSON Schema it can understand? I tried running it against a complex JSON Schema, only...

p2

Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/cdklabs/json2jsii/actions/runs/14369327099 ------ *Automatically created by projen via the "upgrade-dev-deps-main" workflow*

auto-approve

This adds pattern validation for structs and enums. Struct validation is handled in the `toJson` function, and enums are checked at construction time.

Newer JSON schema versions use `$defs` as the path prefix for definitions