All Projects → VanMoof → gopenapi

VanMoof / gopenapi

Licence: MIT license
An OpenAPI v3 utility for Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gopenapi

Routing Controllers Openapi
Runtime OpenAPI v3 schema generation for routing-controllers.
Stars: ✭ 170 (+750%)
Mutual labels:  openapi3
Redoc
📘 OpenAPI/Swagger-generated API Reference Documentation
Stars: ✭ 15,935 (+79575%)
Mutual labels:  openapi3
Full Stack Fastapi Couchbase
Full stack, modern web application generator. Using FastAPI, Couchbase as database, Docker, automatic HTTPS and more.
Stars: ✭ 243 (+1115%)
Mutual labels:  openapi3
Swagger Node Codegen
An OpenAPI 3.x/Swagger 2 code generator for Node.js
Stars: ✭ 189 (+845%)
Mutual labels:  openapi3
Fastapi Gino Arq Uvicorn
High-performance Async REST API, in Python. FastAPI + GINO + Arq + Uvicorn (w/ Redis and PostgreSQL).
Stars: ✭ 204 (+920%)
Mutual labels:  openapi3
Generators
API Generator - instantly generate REST and GraphQL APIs (openapi (OAS) 3.0.0)
Stars: ✭ 213 (+965%)
Mutual labels:  openapi3
Openapi Spec Validator
OpenAPI Spec validator
Stars: ✭ 161 (+705%)
Mutual labels:  openapi3
OpenAPI
A pharo implementation of OpenAPI 3.0.1
Stars: ✭ 20 (+0%)
Mutual labels:  openapi3
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+13075%)
Mutual labels:  openapi3
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+17140%)
Mutual labels:  openapi3
Swagger Js
Javascript library to connect to swagger-enabled APIs via browser or nodejs
Stars: ✭ 2,319 (+11495%)
Mutual labels:  openapi3
Swaggerprovider
F# generative Type Provider for Swagger
Stars: ✭ 201 (+905%)
Mutual labels:  openapi3
Openapi Codegen
OpenAPI 3.0 CodeGen plus Node.js minus the Java and emojis
Stars: ✭ 224 (+1020%)
Mutual labels:  openapi3
Swagger Codegen
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
Stars: ✭ 13,859 (+69195%)
Mutual labels:  openapi3
oas parser
An open source Open API Spec 3 Definition Parser
Stars: ✭ 52 (+160%)
Mutual labels:  openapi3
Openapi Psr7 Validator
It validates PSR-7 messages (HTTP request/response) against OpenAPI specifications
Stars: ✭ 168 (+740%)
Mutual labels:  openapi3
Openapi Diff
Utility for comparing two OpenAPI specifications.
Stars: ✭ 208 (+940%)
Mutual labels:  openapi3
restish
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Stars: ✭ 453 (+2165%)
Mutual labels:  openapi3
openapi-boilerplate
📘 Multi-file boilerplate for Open API Specification
Stars: ✭ 280 (+1300%)
Mutual labels:  openapi3
Spot
Spot is a concise, developer-friendly way to describe your API contract.
Stars: ✭ 230 (+1050%)
Mutual labels:  openapi3

GOpenAPI

CircleCI

An OpenAPI utility for Go. This project aims to bring support of OpenAPI v3.

Usage

$ gopenapi [command] [arg]

Generating Specifications From Code

gopenapi generate spec [optional path] [flags]

Args

[optional path]   Optionally specify the directory in which to search. Accepts absolute paths. Relative paths are relative to the current directory. (default ".")

Flags

-f, --format string   The format of the output. May be json or yaml (default "json")
-o, --output string   Where the output should be directed. May be '-' (stdout) or a path to a file (default "-")

Format

Code is annotated with different types of comments that help generate the spec.

The comment contains a keyword that specifies the type of the OpenAPI element.

The content of the comment should be a valid YAML OpenAPI element

Info

Begin a comment with gopenapi:info and follow up with a YAML representation of the OpenAPI Info element.

This element is then set to the info property of the specification.

package main

/*
gopenapi:info
title: The App Name
version: 1.0
description: |-
  The app description
contact:
  name: Jimbob Jones
  url: https://jones.com
  email: [email protected]
license:
  name: Apache 2.0
  url: https://www.apache.org/licenses/LICENSE-2.0.html
*/
func main() {
}
Path

Begin a comment with gopenapi:path and follow up with a YAML representation of the OpenAPI PathItem element.

This element is then appended to the paths property of the specification.

package main

/*
gopenapi:path
/ping:
  get:
    responses:
      200:
        description: |-
          The default response of "ping"
        content:
          text/plain:
            example: pong
*/
func ControllerFunc() {
}
Object Schema

Annotate a struct with a gopenapi:objectSchema.

The generated ObjectSchema element will be appended to the components.schemas property of the specification.

//gopenapi:objectSchema
type RootModel struct {
	IntField    int64  `json:"intField"`
	StringField string `json:"stringField"`
}

// This struct will be ignored
type IgnoredModel struct {
}

//gopenapi:objectSchema
type AliasedModels []*AliasedModel // This alias will appear as a schema too

//gopenapi:objectSchema
type AliasedModel struct {
	IgnoredField string `json:"-"` // This field will be ignored
	TimeField    time.Time
}
Parameter

Annotate a const or a var with a gopenapi:parameter.

The annotated field will be appended to the components.parameters property of the specification.

/*
gopenapi:parameter
in: path
required: true
content:
  text/plain:
    example: 30
*/
const Limit = "limit"

The name of the field (Limit) will be the parameter identifier and the value of the field (limit) will be the name of the parameter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].