Skip to content

Commit

Permalink
fix: patch array values in response schemas (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored May 17, 2020
1 parent 878dce0 commit 470ccb9
Show file tree
Hide file tree
Showing 2 changed files with 23,265 additions and 23,954 deletions.
7 changes: 7 additions & 0 deletions scripts/update-endpoints/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ async function getResponseSchemasString(responsesSchemas) {

const strings = await Promise.all(
responsesSchemas.map(({ schema, name }) => {
if (name === "ReposListInvitationsResponseData") {
debugger;
}
patchSchema(schema);
return compile(schema, name, { bannerComment: false });
})
Expand All @@ -249,6 +252,10 @@ async function getResponseSchemasString(responsesSchemas) {
}

function patchSchema(schema) {
if (schema.items) {
patchSchema(schema.items);
}

if (!schema.properties) return;

// make all keys required, set additionalProperties to false
Expand Down
Loading

0 comments on commit 470ccb9

Please sign in to comment.