openapi

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 9 Imported by: 0

README

GoREST OpenAPI Plugin

CI Go Report Card License

OpenAPI documentation plugin for GoREST framework.

Installation

go get github.com/nicolasbonnici/gorest-openapi

Usage

import (
	"github.com/nicolasbonnici/gorest/pluginloader"
	openapiplugin "github.com/nicolasbonnici/gorest-openapi"
)

func init() {
	pluginloader.RegisterPluginFactory("openapi", openapiplugin.NewPlugin)
}
Configuration

Add to your gorest.yaml:

plugins:
  - name: openapi
    enabled: true

Features

  • Auto-generated OpenAPI 3.0 specification
  • Interactive API documentation UI at /openapi
  • OpenAPI JSON schema at /openapi.json
  • Dynamic schema generation from database
  • Scalar API reference integration

Endpoints

  • GET /openapi - Interactive API documentation UI
  • GET /openapi.json - OpenAPI 3.0 JSON schema

License

MIT License - see LICENSE file for details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin() plugin.Plugin

Types

type GeneratorConfig added in v0.1.2

type GeneratorConfig struct {
	DTOsDirectory      string
	PaginationLimit    int
	PaginationMaxLimit int
}

type OpenAPIPlugin

type OpenAPIPlugin struct {
	// contains filtered or unexported fields
}

func (*OpenAPIPlugin) Handler

func (p *OpenAPIPlugin) Handler() fiber.Handler

Handler returns a no-op middleware

func (*OpenAPIPlugin) Initialize

func (p *OpenAPIPlugin) Initialize(cfg map[string]interface{}) error

func (*OpenAPIPlugin) Name

func (p *OpenAPIPlugin) Name() string

func (*OpenAPIPlugin) SetupEndpoints

func (p *OpenAPIPlugin) SetupEndpoints(app *fiber.App) error

SetupEndpoints implements the EndpointSetup interface

Jump to

Keyboard shortcuts

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