swagger-api / swagger-api/swagger-codegen

[JAVA-Spring-Server] README.md points to a wrong URL.

Open
#8,633 1 comment 0 reactions 1 assignee View on GitHub

@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:

  1. The class to use is not named. It is the Swagger2SpringBoot

  2. 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
  1. The "start your server" is more verbose.
  2. The URL is correct.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.