openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package openapi adapts shape schemas for OpenAPI 3.1 documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONRequestBody

func JSONRequestBody[T any](schema shape.Schema[T], required bool) (map[string]any, error)

JSONRequestBody builds an OpenAPI requestBody object for JSON input.

func JSONResponse

func JSONResponse[T any](description string, schema shape.Schema[T]) (map[string]any, error)

JSONResponse builds an OpenAPI response object for a JSON response body.

func Schema

func Schema[T any](schema shape.Schema[T]) (map[string]any, error)

Schema exports an OpenAPI 3.1-compatible Schema Object. OpenAPI 3.1 aligns its Schema Object with JSON Schema Draft 2020-12, so the document is the exported schema object without a JSON Schema $schema dialect declaration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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