Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OpenAPI v3.1 Spec implementation in Go with generics

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.go
NotificationsYou must be signed in to change notification settings

sv-tools/openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code AnalysisGo ReferencecodecovGitHub tag (latest SemVer)

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

go get github.com/sv-tools/openapi

Supported Go versions

  • v1.25
  • v1.24
  • v1.23
  • v1.22

Versions

  • v0 -Deprecated. The initial version with the full implementation of the v3.1 Specification using generics. See thev0 branch.
  • v1 - The current version with the in-place validation of the specification.
    • The minimum version of Go isv1.22.
    • Everything has been moved to the root folder. So, the import path isgithub.com/sv-tools/openapi.
    • AddedValidator struct for validation of the specification and the data.
      • Validator.ValidateSpec() method validates the specification.
      • Validator.ValidateData() method validates the data.
      • Validator.ValidateDataAsJSON() method validates the data by converting it intomap[string]any type first usingjson.Marshal andjson.Unmarshal.WARNING: the function is slow due to double conversion.
    • AddedParseObject function to createSchemaBuilder by parsing an object.The function supportsjson,yaml andopenapi field tags for the structs.
    • Use OpenAPIv3.1.1 by default.

Features

  • The official v3.0 and v3.1examples are tested.In most cases, the v3.0 specification can be converted to v3.1 by changing only the version parameter.

    @@ -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 bundledLICENSE file for more details.


[8]ページ先頭

©2009-2025 Movatter.jp