redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Support for OpenAPI const keyword in typescript codegen

Open yanatan16 opened this issue 1 year ago • 0 comments

In OpenApi codegen using the x-const extension, a JSON-Schema field that looks like this:

{"properties": {"literal_value": {"const": "value", "default": "value"},
 "title": "TestLiteralValue"}

produces a type in typescript of:

type TestLiteralValue = {
  literal_value: any
}

but it should generate:

type TestLiteralValue = {
  literal_value: 'value'
}

yanatan16 avatar Feb 19 '24 19:02 yanatan16