You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openapi: 3.0.1info:
title: 'Example'version: '1'paths:
/api/v1/user-profiles:
post:
tags:
- UserProfilessummary: Creates a new user profile.description:
operationId: >- CreateUserProfileModel)parameters:
requestBody:
content:
application/json:
schema:
$ref: >- #/components/schemas/CreateUserProfileModelresponses:
'201':
description: Createdcontent:
application/json:
schema:
$ref: >- #/components/schemas/UserProfileStateDtocomponents:
schemas:
CreateUserProfileModel:
type: objectproperties:
firstName:
maxLength: 50pattern: ^[\p{L}\p{M}\p{Zs}\p{N}'-]+$type: stringdescription: Given name of the usernullable: trueUserProfileStateDto:
type: objectproperties:
id:
type: stringdescription: The Okta user id. Do not use this as a key in applications.nullable: truesecuritySchemes:
Bearer:
type: httpdescription: JWT Bearer Authorization.scheme: bearerbearerFormat: JWTtags:
- name: UserProfilesdescription: Operations for managing user profiles
Describe the bug you're encountering
Given a with a pattern having character categories like \p{N}, Swagger UI is interpreting the braces to mean brace character literal.
The example data that is generated for that property looks like:
The delimiters \p{ followed by } should be treated as a character class instead of seeing { as a character literal to match. I should not see braces in the example value produced.
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered:
richard-collette-precisely
changed the title
Properties with RegEx patterns containing braces renders braces in example values
Properties with RegEx patterns containing a unicode property escape renders braces in example values
Aug 29, 2024
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
Given a with a pattern having character categories like \p{N}, Swagger UI is interpreting the braces to mean brace character literal.
The example data that is generated for that property looks like:
Expected behavior
The delimiters \p{ followed by } should be treated as a character class instead of seeing { as a character literal to match. I should not see braces in the example value produced.
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered: