Closed anshchaturvedi closed 1 month ago
:tada: This PR is included in version @api-ts/openapi-generator@4.25.0 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
:tada: This PR is included in version @api-ts/express-wrapper@1.0.28 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
:tada: This PR is included in version @api-ts/typed-express-router@1.1.8 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
:tada: This PR is included in version @api-ts/superagent-wrapper@1.2.3 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
:tada: This PR is included in version @api-ts/io-ts-http@3.1.0 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
Problem:
Currently,
openapi-generator
only supportst.record
with unrestricted domains. However, there can be codecs that use anenumerable
(usually signified as at.keyof
) to specify that only certain keys are allowed and that all of these keys are required in thet.record
.Our
dev-portal
doesn't fully support renderingt.record
that conforms to the OpenAPI specification, as the rendering code we ~copied~ adopted from @stoplight/json-schema-viewer is outdated and a few versions behind the current release.Solution:
Although a
dev-portal
fix to rendert.record
better is in progress (though it won't be fully complete in its first iteration), we decided to circumvent the inadequate rendering by converting at.record
to at.type
. Both codecs expect all keys to exist in the object and all values of the keys to conform to the specified codec. With this PR, something like:will have its keys "expanded" and inlined by
openapi-generator
when generated, and will be equivalent to:Ticket: DX-637