Skip to content

Commit

Permalink
fix: don't silently drop properties from httpRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
bitgopatmcl committed May 9, 2024
1 parent b2a76ee commit 48821de
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/openapi-generator/src/knownImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,14 @@ export const KNOWN_IMPORTS: KnownImports = {
if (schema.type !== 'object') {
return E.left('httpRoute parameter must be object');
}
const props = Object.entries(schema.properties).reduce((acc, [key, prop]) => {
const derefedE = deref(prop);
const props: Record<string, Schema> = {};
for (const [key, value] of Object.entries(schema.properties)) {
const derefedE = deref(value);
if (E.isLeft(derefedE)) {
return acc;
return derefedE;
}
return { ...acc, [key]: derefedE.right };
}, {});
props[key] = derefedE.right;
}
return E.right({
type: 'object',
properties: props,
Expand Down

0 comments on commit 48821de

Please sign in to comment.