Giter Site home page Giter Site logo

sv-tools / openapi Goto Github PK

View Code? Open in Web Editor NEW
41.0 2.0 7.0 161 KB

OpenAPI v3.1 Spec implementation in Go with generics

License: MIT License

Makefile 0.22% Go 99.78%
openapi3 openapi-validation swagger openapi golang generics-in-golang openapi31

openapi's Introduction

OpenAPI v3.1 Specification

Code Analysis Go Reference codecov GitHub tag (latest SemVer)

The implementation of OpenAPI v3.1 Specification for Go using generics.

Supported Go versions:

  • v1.22
  • v1.21
  • v1.20

Versions:

  • v0 - Deprecated. The initial version with the full implementation of the v3.1 Specification using generics. See v0 branch.
  • v1 - The current version with the in-place validation of the specification. The minimal version of Go is v1.20 and the github.com/santhosh-tekuri/jsonschema/v5 package is not used anymore. See main branch.

Features

  • The spec folder contains full implementation of the v3.1 Specification using generics and errors.Join function, so the minimum supported version of Go is v1.20.
  • The spec.ValidateSpec function validates the specification without transforming it to map[string]any.
  • The official v3.0 and v3.1 examples are tested. In most cases v3.0 specification can be converted to v3.1 by changing the version's parameter only.
    @@ -1,4 +1,4 @@
    -openapi: "3.0.0"
    +openapi: "3.1.0"

NOTE: The descriptions of most structures and their fields are taken from the official documentations.

Links

License

MIT licensed. See the bundled LICENSE file for more details.

openapi's People

Contributors

dependabot[bot] avatar sv-tools-bot avatar svilgelm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openapi's Issues

replacing validate package with in place ValidateSpec function

Does anyone use the validate package? I'm thinking about replacing it with in-place solution, like <T>.ValidateSpec(opts) function.

pros: no external dependencies, more flexible, like the validation of references or examples
cons: the go code should be changed in case of changed official specification

Thank you!

Just wanted to tell you, that this lib is a life safer for me!
Thank you!

I can finally implement an OpenAPI 3.1.0 spec in swaggo.
Already started it, it's working perfectly fine so far.

If i find anything missing, i'll open a PR :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.