swagger-api / swagger-api/swagger-codegen
Running OAS 3.0 in Editor creates error when generating code (server or client)
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
From @peterwilli on October 2, 2018 21:0
Q&A (please complete the following information)
- OS: Linux
- Browser: Chromium
- Version: 69.0.3497.81
- Method of installation: Online editor
- Swagger-Editor version: No version number found in the Online Editor
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Go to https://editor.swagger.io or host your own (I had this issue with both)
Example Swagger/OpenAPI definition:
openapi: "3.0.1"
info:
version: 0.1.0
title: Test API
description: Test API
servers:
- url: "http://localhost:7000"
paths:
/user:
post:
summary: Registers new user
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
username:
type: string
password:
type: string
email:
type: string
required:
- username
- password
- email
example:
username: peterwilli
responses:
'200':
description: |-
200 response
content:
text/plain:
examples:
ok:
value: "ok"
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
- Paste example YAML in editor.
- In the top bar, try to generate any client or server.
- Nothing will happen.
- If you go to the console and the networking tab, you'll see the error there.
Expected behavior
A download with the client or server would be presented.
Screenshots

Additional context or thoughts
The weird thing is that this OAS code does work fine: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
Copied from original issue: swagger-api/swagger-editor#1894
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the example OpenAPI YAML in the issue, load it in the online editor, and inspect the browser console and networking tab while attempting client or server generation. Trace the generation request from the editor entry point; done means a client or server download is presented for this definition, as it is for the linked petstore example.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100