schemagen

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

OAS Schemagen

The initial purpose of this setup is so that eventually any of our repos would be able to import the package and use the methods to compose a wholly unique OpenAPI specification, append to an existing "base" specification, or merge between specifications.

This setup is not yet complete. There are weird quirks between all of the libraries and today ogen is controlling the largest swath of our generated specs, this is the first attempt at composing + outputting specifications based on the REST handlers and interfaces.

Eventually we may be able to use ast, packages, and other walking methods to reference / fetch the structs but for now the handler methods are added through basic functions which map them in the specification correctly.

TO DO

As you may be able to see from the mitb.gen.yaml file, the current setup is only composing Components, and the objects underneath it. The main remaining body of work is:

  • Compose full Operations as a rollup of Requests, Responses, etc.
  • Add methods to range over the registered routes and map them to PathItems which relate to Operations
  • Add meethods to properly merge both json and yaml specifications
  • Append the security method(s) to each operation
  • Add examples to all Components and associated
  • Add basic validations (e.g. every operation must have at least 1 4XX response)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL