class Open::Api
- Open::Api
- Reference
- Object
Included Modules
- JSON::Serializable
- YAML::Serializable
Extended Modules
Defined in:
open-api.cropen-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
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
- .new(info : Open::Api::Info)
- .new(title : String = "Open Api Server")
Class Method Summary
- .route_meta : Hash(String, Hash(String, RouteMetaDatum))
- .route_meta=(route_meta : Hash(String, Hash(String, RouteMetaDatum)))
- .schema_refs : Hash(String, Open::Api::Schema)
- .schema_refs=(schema_refs : Hash(String, Open::Api::Schema))
Instance Method Summary
- #add_path(path, op : String | Open::Api::Operation, item : Open::Api::OperationItem)
- #components : Open::Api::Components
- #components=(components : Open::Api::Components)
-
#has_header_ref?(name : String) : Bool | Nil
Returns
true
if aOpen::Api::Header
is registered under the given name. -
#has_parameter_ref?(name : String) : Bool | Nil
Returns
true
if aOpen::Api::Parameter
is registered under the given name. -
#has_response_ref?(name : String) : Bool | Nil
Returns
true
if aOpen::Api::Response
is registered under the given name. -
#has_schema_ref?(name : String) : Bool | Nil
Returns
true
if aOpen::Api::Schema
is registered under the given name. -
#has_security_scheme_ref?(name : String) : Bool | Nil
Returns
true
if aOpen::Api::Security::Scheme
is registered under the given name. -
#header_ref(name : String) : Open::Api::Ref
Retrieves a
Open::Api::Ref
by name if it is registered - #info : Open::Api::Info
- #info=(info : Open::Api::Info)
- #openapi : String
- #openapi=(openapi : String)
-
#parameter_ref(name : String) : Open::Api::Ref
Retrieves a
Open::Api::Ref
by name if it is registered - #paths : Open::Api::Paths
- #paths=(paths : Open::Api::Paths)
-
#register_header(name : String, obj : Open::Api::Header)
Register a
Open::Api::Header
to be used by the OpenAPI spec. -
#register_parameter(name : String, obj : Open::Api::Parameter)
Register a
Open::Api::Parameter
to be used by the OpenAPI spec. -
#register_response(name : String, obj : Open::Api::Response)
Register a
Open::Api::Response
to be used by the OpenAPI spec. -
#register_schema(name : String, obj : Open::Api::Schema)
Register a
Open::Api::Schema
to be used by the OpenAPI spec. -
#register_security_scheme(name : String, obj : Open::Api::Security::Scheme)
Register a
Open::Api::Security::Scheme
to be used by the OpenAPI spec. -
#response_ref(name : String) : Open::Api::Ref
Retrieves a
Open::Api::Ref
by name if it is registered -
#schema_ref(name : String) : Open::Api::Ref
Retrieves a
Open::Api::Ref
by name if it is registered -
#security : Array(Open::Api::Security::Requirement) | Nil
Apply the security globally to all operations
-
#security=(security : Array(Open::Api::Security::Requirement) | Nil)
Apply the security globally to all operations
-
#security_scheme_ref(name : String) : Open::Api::Ref
Retrieves a
Open::Api::Ref
by name if it is registered - #servers : Array(Open::Api::Server)
- #servers=(servers : Array(Open::Api::Server))
Constructor Detail
Class Method Detail
Instance Method Detail
Returns true
if a Open::Api::Header
is registered under the given name. Returns false
otherwise.
Returns true
if a Open::Api::Parameter
is registered under the given name. Returns false
otherwise.
Returns true
if a Open::Api::Response
is registered under the given name. Returns false
otherwise.
Returns true
if a Open::Api::Schema
is registered under the given name. Returns false
otherwise.
Returns true
if a Open::Api::Security::Scheme
is registered under the given name. Returns false
otherwise.
Retrieves a Open::Api::Ref
by name if it is registered
Retrieves a Open::Api::Ref
by name if it is registered
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.
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.
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.
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.
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.
Retrieves a Open::Api::Ref
by name if it is registered
Retrieves a Open::Api::Ref
by name if it is registered
Apply the security globally to all operations
Apply the security globally to all operations
Retrieves a Open::Api::Ref
by name if it is registered