Skip to content

Commit

Permalink
Merge pull request #787 from BitGo/DX-455-format-tag
Browse files Browse the repository at this point in the history
feat: add support for `format` tag in openapi generator
  • Loading branch information
bitgopatmcl authored Jun 6, 2024
2 parents 421fd5e + 540de97 commit 27b380a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/openapi-generator/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function schemaToOpenAPI(
const maxLength = getTagName(schema, 'maxLength');
const minLength = getTagName(schema, 'minLength');
const pattern = getTagName(schema, 'pattern');
const format = getTagName(schema, 'format');

const deprecated = schema.comment?.tags.find((t) => t.tag === 'deprecated');
const description = schema.comment?.description;
Expand All @@ -151,6 +152,7 @@ function schemaToOpenAPI(
...(maxLength ? { maxLength: Number(maxLength) } : {}),
...(minLength ? { minLength: Number(minLength) } : {}),
...(pattern ? { pattern } : {}),
...(format ? { format } : {}),
};
return defaultOpenAPIObject;
}
Expand Down

0 comments on commit 27b380a

Please sign in to comment.