swaggo / echo-swagger

echo middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
817 stars 127 forks source link

No operations defined in spec! #70

Open VNAPNIC opened 2 years ago

VNAPNIC commented 2 years ago

No operations defined in spec!

Web capture_16-1-2022_3384_localhost

Web capture_16-1-2022_33729_editor swagger io

definitions:
  response.Struct:
    properties:
      code:
        type: integer
      data: {}
      message:
        type: string
      time_stamp:
        type: integer
    type: object
  services.AuthStruct:
    properties:
      password:
        maxLength: 20
        minLength: 6
        type: string
      user_name:
        maxLength: 20
        minLength: 6
        type: string
    required:
    - password
    - user_name
    type: object
info:
  contact: {}
paths:
  /login:
    post:
      consumes:
      - application/json
      description: User Login
      parameters:
      - description: user login
        in: body
        name: payload
        required: true
        schema:
          $ref: '#/definitions/services.AuthStruct'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/response.Struct'
        "400":
          description: wrong request parameter
          schema:
            $ref: '#/definitions/response.Struct'
        "20005":
          description: The corresponding username or password is incorrect
          schema:
            $ref: '#/definitions/response.Struct'
      summary: User Login
      tags:
      - Auth
securityDefinitions:
  ApiKeyAuth:
    in: 'header like: Bearer xxxx'
    name: Authorization
    type: apiKey
swagger: "2.0"
ElForastero commented 2 years ago

Check if it helps:

https://github.com/swaggo/echo-swagger/issues/66#issuecomment-1046084131