Skip to content

basic authentication not listed in generated static HTML #1158

@arnested

Description

@arnested

If I generate static HTML from the "basic-auth.yaml" example with:

java -jar ./swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i basic-auth.yaml -o ~/docs

The generated HTML will have a "Access" heading but no security definitions will be listed under it and no security requirement will be listed under the path item either.

basic-auth.yaml:

---
swagger: '2.0'
info:
  version: "1.0.0"
  title: Basic Auth Example
  description: |
    An example for how to use Basic Auth with Swagger.
    Server code is available [here](https://github.com/mohsen1/basic-auth-server). It's running on Heroku.

    **User Name and Password**
    * User Name: `user`
    * Password: `pass`
host: basic-auth-server.herokuapp.com
schemes:
  - http
  - https
securityDefinitions:
  basicAuth:
    type: basic
    description: HTTP Basic Authentication. Works over `HTTP` and `HTTPS`
paths:
  /:
    get:
      security:
       - basicAuth: []
      responses:
        200:
          description:  Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions