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: OpenAPI definitionversion: v0servers:
- url: http://localhost:8080description: Generated server urltags:
- name: user-v1description: User v1 APIpaths:
/users/v1:
get:
tags:
- user-v1summary: Find Users based on filter criteriaoperationId: getresponses:
"200":
description: OKcontent:
'*/*':
schema:
$ref: '#/components/schemas/User'components:
schemas:
User:
required:
- email
- usernametype: objectproperties:
username:
pattern: "^(?=.{4,256}$)(?:[a-zA-Z\\d]+(?:[.\\-_@][a-zA-Z\\d])*)+$"type: stringdescription: User name of a given useremail:
pattern: "^[\\w-.]+@([\\w-]+\\.)+[\\w-]{2,4}$"type: stringdescription: E-mail of a given userdescription: Properties for creation of a user
Swagger-UI configuration options:
window.onload=function(){//<editor-fold desc="Changeable Configuration Block">// the following lines will be replaced by docker/configurator, when it runs in a docker-containerwindow.ui=SwaggerUIBundle({url: "https://petstore.swagger.io/v2/swagger.json",dom_id: '#swagger-ui',deepLinking: true,presets: [SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset],plugins: [SwaggerUIBundle.plugins.DownloadUrl],layout: "StandaloneLayout","configUrl" : "/v3/api-docs/swagger-config","validatorUrl" : ""});//</editor-fold>};
Q&A (please complete the following information)
(*) WebJar downloads a distribution from github and copies over your dist folder, see https://github.com/webjars/swagger-ui/blob/master/pom.xml#L22 and https://github.com/webjars/swagger-ui/blob/master/pom.xml#L110
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Not sure what this is, but I have:
Describe the bug you're encountering
When a pattern is added to a schema property, and no default value is provided, the example shown in swagger ui is literal gibberish.
To reproduce...
Steps to reproduce the behavior:
The schema is provided as-is. I have first encountered this using a spring-boot application that I put at
https://github.com/ZIRAKrezovic/openapi-report
Requires Java 17
Build and run with:
Navigate to http://localhost:8080/swagger-ui/index.html#/user-v1/get
Expected behavior
I would expect a sane example value is shown on the UI
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered: