OAS 3.0 | Swagger-UI | Required input parameters not getting validated
See original GitHub issueI downloaded the Swagger-UI 3.X
code from https://github.com/swagger-api/swagger-ui as of 10/11/2017.
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | Open Api 3.0 |
Which Swagger-UI version? | swagger-ui, 3.x |
How did you install Swagger-UI? | Dowloaded zip, extracted the /dist folder and added my yaml file to it. |
Which browser & version? | Chrome Version 61.0.3163.91 |
Which operating system? | macOS Sierrra |
Demonstration API definition
openapi: "3.0.0"
info:
version: 1.0.0
title: Example API
description: A sample API using OpenApi 3.0
contact:
name: ABC
email: test@test.com
servers:
- url: http://localhost:8080
description: Local instance of API
paths:
/examples/{id}:
get:
tags: [examples]
description: Test path
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: test
in: query
description: test query
required: false
schema:
type: string
example: test
responses:
'200':
description: test response
content:
application/json:
schema:
type: string
example: success
Extracted the dist
folder from swagger-UI and added the followingswaggerEx.yaml
file to it:
In the index.html
folder I made the following change:
// Build a system
const ui = SwaggerUIBundle({
url: "swaggerEx.yaml",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
Expected Behavior
As in swagger 2.0, I expected that the required parameters would be validated such as:

Current Behavior
With the new UI I see that the required
parameter validation does not occur and the call keeps loading
but never gets executed. Here is a screen shot with that behavior:
Context
We are trying to document our API using Swagger. Right now the documentation part works but if we want to provide user with the ability to try out the API we cannot do that because of this issue.
Thank you.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Describing Parameters - Swagger
Query parameters can be primitive values, arrays and objects. OpenAPI 3.0 provides several ways to serialize objects and arrays in the query string....
Read more >Parameter(required = false) not working in swagger open api v3
my problem is with annotation @Parameter that belongs to io.swagger.v3.oas.annotations.Parameter. by default should be required = false, but as ...
Read more >Using OpenAPI and Swagger UI - Quarkus
An OpenAPI document that conforms to the OpenAPI Specification is itself a valid JSON object, that can be represented in yaml or json...
Read more >Fix Swagger Validator errors in Power Platform connectors
Body or form data parameters are not supported in a fetch operation. Operations using the “GET” HTTP method can't have a body or...
Read more >What's New in SwaggerHub - SmartBear Support
oas =3.0.0 query parameter - this is no longer needed. The oas parameter has been removed. Updated Swagger UI to 3.38.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same issue in openapi 3.0
Still seeing this issue using OpenAPI 3.0