Input JSON
I have huge JSON. This is an excerpt of it.
{
"base.get.v1.Input": {
"properties": {
"request": {
"$ref": "#/components/schemas/base.get.v1.Input.Request"
},
"id": {
"maxLength": 128,
"type": "string"
}
},
"required": ["id"],
"type": "object"
}
}
Output interface
Using OpenApi-generator-cli-3.0.0.jar i get the following typescript file (relative to che part of JSON showed before):
import { BaseGetV1InputRequest } from './baseGetV1InputRequest';
export interface BaseGetV1Input {
request?: BaseGetV1InputRequest;
trid: string;
}
Desired result
Is there a way to have the request
object (and subsequent objects) be expanded (solver or exploded, whatever term you prefer). I would like the final interface to be like that:
import { BaseGetV1InputRequest } from './baseGetV1InputRequest';
export interface BaseGetV1Input {
request?: {
entity?: {
code?: 0,
id?: string
},
procedure?: string,
search?: {
type?: "starts" | "contains",
value?: string
}
},
trid: string
}
Tested solutions that don't work
I have tried to solve the $ref myself using json-schema-ref-parser
but i think the codegen creates a sub-model when it finds properties
inside of the input JSON.
I have also tried w/ and w/o mustache templates (that someone else got me). But the output didn't change.
I'm fairly new to OpenAPI, hope you can help me.