Skip to content

Parse Enum values as literals #508

@notaphplover

Description

@notaphplover

Description

Enum values should be parsed as literals as the spec states.

Expected behavior:

The following JSONSchema:

{
  "title": "Enum with JSON literal",
  "enum": [ { "type": "string" } ]
}

should be transpiled into the following typescript model:

export type EnumWithJSONLiteral = {type: "string"};

Current behavior:

The following JSONSchema:

{
  "title": "Enum with JSON literal",
  "enum": [ { "type": "string" } ]
}

is transpiled into the following typescript model:

export type EnumWithJSONLiteral = string;

Context

Consider the specs as references:

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions