QID 570047

QID 570047: Missing Examples in Swagger File in Open API 3.0

Examples are really important. When defining an OpenAPI specification, ensure every definition, operation request and response have examples. Analyzing the swagger file resulted in examples missing on some elements.

It is not mandatory to have examples. Examples help API users to ensure they are making best use of functionality. If example is missing in one of the following elements this warning will be reported:

Operation Requests
Operation Responses
Operation Parameters
Global Components
Global Parameters
Example Schema Check
Use of value/externalValue

Solution
Add examples to all elements. For example:

paths: /users: post: operationId: createUser tags: - "Users" summary: Create a new user description: A new user account. requestBody: description: Give us the new user name content: application/json: schema: $ref: '#/components/schemas/User' examples: TemporaryUser: summary: User will be on the system for a short period of time. value: name: UserName1 ActiveYears: 3 PermanantUser: summary: User will be on the system indefinitely value: name: UserName2 ActiveYears: 100 responses: "200": description: User account created active for requested years content: application/json: schema: $ref: '#/components/schemas/User' examples: TemporaryUser: summary: Temporary user Created with information provided. value: name: UserName1 ActiveYears:2 PermanantUser: summary: Permanant user for life time created using information provided. value: name: UserName2 ActiveYears: 100

Vendor References

CVEs related to QID 570047

Software Advisories
Advisory ID Software Component Link

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report