We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.6.1
20
macOs 14.6
When generating a schema from my openapi specification I get this schema:
OfferBasePersonInternalRequest: { /** Format: int64 */ id?: number; cif?: string; personType?: string; phone?: string; email?: string; address?: components["schemas"]["OfferAddressInternalRequest"]; }; OfferCompanyPersonInternalRequest: { personType: "OfferCompanyPersonInternalRequest"; } & (Omit<components["schemas"]["OfferBasePersonInternalRequest"], "personType"> & { caenCode?: string; companyName?: string; companyType?: string; }); OfferIndividualPersonInternalRequest: { personType: "OfferIndividualPersonInternalRequest"; } & (Omit<components["schemas"]["OfferBasePersonInternalRequest"], "personType"> & { firstName?: string; lastName?: string; foreignPerson?: boolean; identityDocumentNo?: string; identityDocumentSeries?: string; });
the value of personType is incorrect. It should be a string, but here is constrained to be the name of the schema.
This is a my definition:
BasePersonInternalResponse: type: object properties: id: type: integer format: int64 cif: type: string personType: type: string phone: type: string email: type: string address: $ref: '#/components/schemas/PersonAddressResponse' discriminator: propertyName: personType CompanyPersonInternalResponse: type: object allOf: - $ref: '#/components/schemas/BasePersonInternalResponse' - type: object properties: caenCode: type: string companyName: type: string companyType: type: string IndividualPersonInternalResponse: type: object allOf: - $ref: '#/components/schemas/BasePersonInternalResponse' - type: object properties: firstName: type: string lastName: type: string identityDocumentNo: type: string identityDocumentSeries: type: string
Use the schemas that I've put in description combined like this:
user: oneOf: - $ref: '#/components/schemas/OfferCompanyPersonInternalRequest' - $ref: '#/components/schemas/OfferIndividualPersonInternalRequest'
personType should be of type string.
npx @redocly/cli@latest lint
The text was updated successfully, but these errors were encountered:
No branches or pull requests
openapi-typescript version
7.6.1
Node.js version
20
OS + version
macOs 14.6
Description
When generating a schema from my openapi specification I get this schema:
the value of personType is incorrect. It should be a string, but here is constrained to be the name of the schema.
This is a my definition:
Reproduction
Use the schemas that I've put in description combined like this:
Expected result
personType should be of type string.
Required
npx @redocly/cli@latest lint
)Extra
The text was updated successfully, but these errors were encountered: