bcherny/json-schema-to-typescript

Invalid output for empty json schema

Open

#374 opened on Mar 12, 2021

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (449 forks)github user discovery
buggood first issuehelp wanted

Repository metrics

Stars
 (3,302 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Both the following schemas

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Empty",
  "type": "object",
  "additionalProperties": false
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Empty",
  "type": "object",
  "additionalProperties": false,
  "properties": {
  }
}

results in the following output

/* tslint:disable */
/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

export type Empty = {

Note, the missing end-curly-parenthesis

Contributor guide