Skip to content

Releases: slackhq/hack-json-schema

Add hackIgnoreRefs option

23 Feb 20:16
185a005
Compare
Choose a tag to compare
  • #82: add hackIgnoreRefs option for preventing circular references

Support generation of Hack Enum

04 Jan 23:29
54f3ad2
Compare
Choose a tag to compare

Bugfix: Allow generating empty shapes

09 Mar 23:04
de4af98
Compare
Choose a tag to compare

Generate unions for shapes

03 Jan 22:38
8fa6864
Compare
Choose a tag to compare
  • #78: Generate unions of shapes
  • #77: CI: Use Docker
  • #76: Generate Nonnull Types for Unions

Generate unions for oneOf schemas

10 Oct 17:11
134c943
Compare
Choose a tag to compare
  • #74: Support type inference for oneOf schemas

Improvements to `discardAdditionalProperties`

15 Jul 15:50
06164dc
Compare
Choose a tag to compare
  • #73: Make discardAdditionalProperties an object-level concern

Improve generated type for anyOf constraints

26 Apr 18:00
a1afe6c
Compare
Choose a tag to compare
  • #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 a Typing namespace as a foundation atop which to build more complex type inference.

Use null type; handle coercion for anyOf

19 Apr 03:14
6c0934b
Compare
Choose a tag to compare
  • #68: Handle string to object coercion correctly for optimized anyOf constraints
  • #69: Type NullBuilder correctly

Alias top-level refs

11 Apr 22:31
425ef79
Compare
Choose a tag to compare

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

30 Mar 17:28
99b251b
Compare
Choose a tag to compare
  • 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. Call getFile() on the Codegen object to get the generated file.