Releases: slackhq/hack-json-schema
Releases · slackhq/hack-json-schema
Add hackIgnoreRefs option
- #82: add hackIgnoreRefs option for preventing circular references
Support generation of Hack Enum
Bugfix: Allow generating empty shapes
Generate unions for shapes
Generate unions for oneOf schemas
- #74: Support type inference for oneOf schemas
Improvements to `discardAdditionalProperties`
- #73: Make
discardAdditionalProperties
an object-level concern
Improve generated type for anyOf constraints
- #67: Generate "Union" Types for anyOf Constraint. Supports inferring the lowest upper bound type for
anyOf
constraints. Does not yet handle shapes or dicts, but does handle arraykeys, vecs and nums. Introduces aTyping
namespace as a foundation atop which to build more complex type inference.
Use null type; handle coercion for anyOf
Alias top-level refs
Instead of doing a no-op when the schema is a top-level ref, generate a validator and type which just alias the referenced validator and type. This fits better with existing tooling which expects a type and validator to be generated.
Support top-level refs; support uniqueItems when items contains a ref
- Support top-level refs (e.g., schemas declared as
{"$ref": "..."}
. For these schemas, we'll ensure the referenced schema has a generated validator and type, but we won't generate any new code. - Correctly handle the case where an array specifies
uniqueItems
and has an item which is a$ref
. - Breaking change:
Codegen::build()
no longer returns a file. CallgetFile()
on theCodegen
object to get the generated file.