class Open::Api

Included Modules

Extended Modules

Defined in:

open-api.cr
open-api/class_methods.cr
open-api/components.cr
open-api/example.cr
open-api/header.cr
open-api/info.cr
open-api/media_type.cr
open-api/operation.cr
open-api/operation_item.cr
open-api/parameter.cr
open-api/path_item.cr
open-api/ref.cr
open-api/request_body.cr
open-api/response.cr
open-api/schema.cr
open-api/server.cr
open-api/version.cr

Constant Summary

COMP_TYPES = {schema: Open::Api::Schema, response: Open::Api::Response, parameter: Open::Api::Parameter, header: Open::Api::Header, security_scheme: Open::Api::Security::Scheme}
VERSION = {{ (`shards version \"/srv/crystaldoc.info/github-spoved-open-api.cr-v0.2.10/src/open-api\"`).chomp.stringify }}

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(info : Open::Api::Info) #

[View source]
def self.new(title : String = "Open Api Server") #

[View source]

Class Method Detail

def self.route_meta : Hash(String, Hash(String, RouteMetaDatum)) #

[View source]
def self.route_meta=(route_meta : Hash(String, Hash(String, RouteMetaDatum))) #

[View source]
def self.schema_refs : Hash(String, Open::Api::Schema) #

[View source]
def self.schema_refs=(schema_refs : Hash(String, Open::Api::Schema)) #

[View source]

Instance Method Detail

def add_path(path, op : String | Open::Api::Operation, item : Open::Api::OperationItem) #

[View source]
def components : Open::Api::Components #

[View source]
def components=(components : Open::Api::Components) #

[View source]
def has_header_ref?(name : String) : Bool | Nil #

Returns true if a Open::Api::Header is registered under the given name. Returns false otherwise.


[View source]
def has_parameter_ref?(name : String) : Bool | Nil #

Returns true if a Open::Api::Parameter is registered under the given name. Returns false otherwise.


[View source]
def has_response_ref?(name : String) : Bool | Nil #

Returns true if a Open::Api::Response is registered under the given name. Returns false otherwise.


[View source]
def has_schema_ref?(name : String) : Bool | Nil #

Returns true if a Open::Api::Schema is registered under the given name. Returns false otherwise.


[View source]
def has_security_scheme_ref?(name : String) : Bool | Nil #

Returns true if a Open::Api::Security::Scheme is registered under the given name. Returns false otherwise.


[View source]
def header_ref(name : String) : Open::Api::Ref #

Retrieves a Open::Api::Ref by name if it is registered


[View source]
def info : Open::Api::Info #

[View source]
def info=(info : Open::Api::Info) #

[View source]
def openapi : String #

[View source]
def openapi=(openapi : String) #

[View source]
def parameter_ref(name : String) : Open::Api::Ref #

Retrieves a Open::Api::Ref by name if it is registered


[View source]
def paths : Open::Api::Paths #

[View source]
def paths=(paths : Open::Api::Paths) #

[View source]
def register_header(name : String, obj : Open::Api::Header) #

Register a Open::Api::Header to be used by the OpenAPI spec. Will be stored in components.headers. Use #header_ref to fetch a Open::Api::Ref to a header definition.


[View source]
def register_parameter(name : String, obj : Open::Api::Parameter) #

Register a Open::Api::Parameter to be used by the OpenAPI spec. Will be stored in components.parameters. Use #parameter_ref to fetch a Open::Api::Ref to a parameter definition.


[View source]
def register_response(name : String, obj : Open::Api::Response) #

Register a Open::Api::Response to be used by the OpenAPI spec. Will be stored in components.responses. Use #response_ref to fetch a Open::Api::Ref to a response definition.


[View source]
def register_schema(name : String, obj : Open::Api::Schema) #

Register a Open::Api::Schema to be used by the OpenAPI spec. Will be stored in components.schemas. Use #schema_ref to fetch a Open::Api::Ref to a schema definition.


[View source]
def register_security_scheme(name : String, obj : Open::Api::Security::Scheme) #

Register a Open::Api::Security::Scheme to be used by the OpenAPI spec. Will be stored in components.security_schemes. Use #security_scheme_ref to fetch a Open::Api::Ref to a security_scheme definition.


[View source]
def response_ref(name : String) : Open::Api::Ref #

Retrieves a Open::Api::Ref by name if it is registered


[View source]
def schema_ref(name : String) : Open::Api::Ref #

Retrieves a Open::Api::Ref by name if it is registered


[View source]
def security : Array(Open::Api::Security::Requirement) | Nil #

Apply the security globally to all operations


[View source]
def security=(security : Array(Open::Api::Security::Requirement) | Nil) #

Apply the security globally to all operations


[View source]
def security_scheme_ref(name : String) : Open::Api::Ref #

Retrieves a Open::Api::Ref by name if it is registered


[View source]
def servers : Array(Open::Api::Server) #

[View source]
def servers=(servers : Array(Open::Api::Server)) #

[View source]