-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when UI is generated for two sources #166
Comments
Any workaround to resolve it? |
This seems stale to say the least, but for people coming here from Google, I took the direction of combining multiple files to one before using this plugin. I opened an issue to suggest the implementation of a For now, the workaround I use is an added task to compile the YAML files before using the plugin: task compileSwaggerSchema(type: Exec) {
inputs.files 'api.yml', 'index.yml', 'models.yml'
outputs.file 'documentation/api/schemas/v1/schema.yml'
workingDir 'documentation/api/schemas/v1'
commandLine 'bash', '-c', 'npx swagger-cli bundle --outfile schema.yml --type yaml index.yml'
}
generateSwaggerUI.dependsOn compileSwaggerSchema Example openapi: 3.0.0
paths:
$ref: "./api.yml"
components:
schemas:
$ref: "./models.yml" # api.yml
/:
get:
responses:
'200':
description: The authentication process was started successfully.
content:
application/json:
schema:
$ref: './models.yml#/Response'
# models.yml
Response:
type: object
properties:
foo:
type: string The workaround requires |
Describe the bug
Gives following error when two or more sources are used under swaggerSources while generating UI. It works well for single source.
To Reproduce:
Use following code, then generate UI
Expected behavior:
Should generate working UI for both sources.
Environment
Plugin version:
2.10.0 (tested with latest 2.18.1 also)
Swagger Codegen version: 2.3.1
Gradle version: 4.5.1
Java version: 1.8
OS: Windows 10
The text was updated successfully, but these errors were encountered: