Skip to content

Examples in the README.md are not very helpful.  #536

@dwjohnston

Description

@dwjohnston

For context, I'm someone who doesn't have any experience with Go or API frameworks for Go such as gorilla/mux. I do have plenty experience with creating APIs with Node.js.

As far as I can tell - the examples in the main readme do not reflect a practical application of the tooling.

I've taken the second example (Validating HTTP Request/Responses) pasted it into a main.go and pasted in an example OpenAPI file that fits:

#openapi3_spec.yaml
openapi: 3.1.0
info:
  title: Demo
  description: |
    demo demo demo
  version: 1.0.0

paths:
  /items:
    get:
      summary: demo
      operationId: get-items
      responses:
        "200":
          description: "OK"
          content:
            application/json:
              schema:
                type: object

When we run this, we don't get any errors - but we don't get a running server either - the code just executes and exits.

Repro of this here

Instructions

  • Check out the code
  • cd api-go
  • go get ./... && go run main2.go

It would be a whole more helpful if you can provide examples how how this should fit in with use of gorilla/mux - if that's the intended tooling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions