swagger-api / swagger-api/swagger-codegen
[JAVA-Spring-Server] README.md points to a wrong URL.
Open
@HugoMario is already working on this.
Since Sep 5, 2018.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
There are two problems with README:
-
The class to use is not named. It is the Swagger2SpringBoot
-
The path to access is not necessarily /. It might be affected by what is configured in the openapi.yaml
Swagger-codegen version
swagger-codegen-cli-3.0.0-20180717.153005-90
Swagger declaration file content
openapi: 3.0.0
servers:
- url: 'http://localhost:8080/v1'
info:
version: 0.0.0
title: Example
paths:
/randomPet:
get:
responses:
'200':
description: Random pet
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
components:
schemas:
Pet:
type: object
required:
- petType
properties:
petType:
type: string
Generated README.md
# Swagger generated server
Spring Boot Server
## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.
By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub.
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.
The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
Start your server as an simple java application
You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/
Change default port value in application.properties
Expected
- The "start your server" is more verbose.
- The URL is correct.
- The advice to check the application.properties is more prominent.
For example:
# Swagger generated server
Spring Boot Server
## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.
By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub.
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.
The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
1. Adjust your applications settings in src/main/resources/application.properties
2. Start your server (class io.swagger.Swagger2SpringBoot) as a simple java application
You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/v1/
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.
Assessment
This issue has not been assessed yet.