Skip to content

Commit 27b380a

Browse files
authored
Merge pull request #787 from BitGo/DX-455-format-tag
feat: add support for `format` tag in openapi generator
2 parents 421fd5e + 540de97 commit 27b380a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/openapi-generator/src/openapi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function schemaToOpenAPI(
139139
const maxLength = getTagName(schema, 'maxLength');
140140
const minLength = getTagName(schema, 'minLength');
141141
const pattern = getTagName(schema, 'pattern');
142+
const format = getTagName(schema, 'format');
142143

143144
const deprecated = schema.comment?.tags.find((t) => t.tag === 'deprecated');
144145
const description = schema.comment?.description;
@@ -151,6 +152,7 @@ function schemaToOpenAPI(
151152
...(maxLength ? { maxLength: Number(maxLength) } : {}),
152153
...(minLength ? { minLength: Number(minLength) } : {}),
153154
...(pattern ? { pattern } : {}),
155+
...(format ? { format } : {}),
154156
};
155157
return defaultOpenAPIObject;
156158
}

0 commit comments

Comments
 (0)