{"modulePath":"github.com/mutablelogic/go-server","version":"v1.8.35","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package openapi\n\n## Functions\n\n```go\nfunc NamedSchema(title string, schema *jsonschema.Schema) *jsonschema.Schema\n```\nNamedSchema clones a schema and applies a title to the clone.\n\n```go\nfunc Operation(summary string, opts ...OperationOpt) schema.Operation\n```\nOperation builds an OpenAPI operation from a summary and option list.\n\n```go\nfunc Operations(pathitem *schema.PathItem, fn func(method string, op *schema.Operation))\n```\nOperations calls fn for each non-nil operation in the PathItem, passing the HTTP method name and a pointer to the operation.\n\n## Types\n\n```go\ntype MarkdownDoc struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ParseMarkdown(data []byte) (doc *MarkdownDoc)\n```\n\n```go\nfunc (doc *MarkdownDoc) FindSection(title string) *markdown.Heading\n```\nFindSection returns the first heading whose text matches title.\n\n```go\nfunc (doc *MarkdownDoc) Section(level int, title string) Section\n```\n\n```go\nfunc (doc *MarkdownDoc) Sections() []Section\n```\n\n```go\ntype OperationOpt func(*opopt)\n```\nOperationOpt applies a configuration change to an OpenAPI operation.\n\n```go\nfunc WithDeprecated() OperationOpt\n```\nWithDeprecated marks the operation as deprecated.\n\n```go\nfunc WithDescription(description string) OperationOpt\n```\nWithDescription sets the operation description.\n\n```go\nfunc WithErrorResponse(status int, description ...string) OperationOpt\n```\nWithErrorResponse sets a JSON error response using httpresponse.ErrResponse.\n\n```go\nfunc WithFormRequest(schemas ...*jsonschema.Schema) OperationOpt\n```\nWithFormRequest sets the form-encoded request body schema.\n\n```go\nfunc WithID(id string) OperationOpt\n```\nWithID sets the operation identifier.\n\n```go\nfunc WithJSONRequest(schemas ...*jsonschema.Schema) OperationOpt\n```\nWithJSONRequest sets the JSON request body schema.\n\n```go\nfunc WithJSONResponse(status int, r *jsonschema.Schema) OperationOpt\n```\nWithJSONResponse sets the JSON response schema for a status code.\n\n```go\nfunc WithMultipartRequest(schemas ...*jsonschema.Schema) OperationOpt\n```\nWithMultipartRequest sets the multipart form request body schema.\n\n```go\nfunc WithNamedFormRequest(title string, schemas ...*jsonschema.Schema) OperationOpt\n```\nWithNamedFormRequest sets a titled form-encoded request body schema.\n\n```go\nfunc WithNamedJSONRequest(title string, schemas ...*jsonschema.Schema) OperationOpt\n```\nWithNamedJSONRequest sets a titled JSON request body schema.\n\n```go\nfunc WithNamedMultipartRequest(title string, schemas ...*jsonschema.Schema) OperationOpt\n```\nWithNamedMultipartRequest sets a titled multipart form request body schema.\n\n```go\nfunc WithNamedRequest(contentType, title string, schemas ...*jsonschema.Schema) OperationOpt\n```\nWithNamedRequest sets the request body schema for a specific content type and applies a title to the generated wrapper schema.\n\nWhen more than one schema is provided, they are wrapped in a titled \\`oneOf\\` schema.\n\n```go\nfunc WithNoContentResponse(status int, description ...string) OperationOpt\n```\nWithNoContentResponse sets a response with no body for a status code.\n\n```go\nfunc WithQuery(q *jsonschema.Schema) OperationOpt\n```\nWithQuery adds query parameters inferred from a JSON schema.\n\n```go\nfunc WithRequest(contentType string, schemas ...*jsonschema.Schema) OperationOpt\n```\nWithRequest sets the request body schema for a specific content type.\n\nWhen more than one schema is provided, they are wrapped in a \\`oneOf\\` schema.\n\n```go\nfunc WithResponse(status int, contentType string, r *jsonschema.Schema, description ...string) OperationOpt\n```\nWithResponse sets the response schema for a status code and content type.\n\n```go\nfunc WithSecurity(schemeName string, enabled bool, scopes ...string) OperationOpt\n```\nWithSecurity adds a security requirement to the operation.\n\n```go\nfunc WithTags(tags ...string) OperationOpt\n```\nWithTags appends tags to the operation.\n\n```go\nfunc WithTextResponse(status int, description string) OperationOpt\n```\nWithTextResponse sets a plain-text response for a status code.\n\n```go\nfunc WithTextStreamResponse(status int, description ...string) OperationOpt\n```\nWithTextStreamResponse sets a text/event-stream style response for a status code.\n\n```go\ntype Section struct {\n\tLevel int\n\tTitle string\n\tBody  string\n}\n```\n\n","path":"github.com/mutablelogic/go-server/pkg/openapi","name":"openapi","synopsis":"","isRedistributable":true}
