jsapi 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jsapi/controller/error_result.rb +1 -2
- data/lib/jsapi/controller/methods.rb +16 -19
- data/lib/jsapi/controller/parameters.rb +7 -8
- data/lib/jsapi/controller/parameters_invalid.rb +1 -2
- data/lib/jsapi/controller/response.rb +4 -2
- data/lib/jsapi/dsl/callbacks.rb +1 -1
- data/lib/jsapi/dsl/definitions.rb +3 -3
- data/lib/jsapi/dsl/error.rb +3 -5
- data/lib/jsapi/dsl/examples.rb +1 -1
- data/lib/jsapi/dsl/openapi/callback.rb +1 -1
- data/lib/jsapi/dsl/openapi/root.rb +115 -1
- data/lib/jsapi/dsl/operation.rb +50 -11
- data/lib/jsapi/dsl/parameter.rb +19 -0
- data/lib/jsapi/dsl/request_body.rb +12 -0
- data/lib/jsapi/dsl/response.rb +19 -0
- data/lib/jsapi/dsl/schema.rb +140 -14
- data/lib/jsapi/json/array.rb +2 -3
- data/lib/jsapi/json/null.rb +2 -2
- data/lib/jsapi/json/object.rb +1 -1
- data/lib/jsapi/json/string.rb +25 -11
- data/lib/jsapi/json/value.rb +5 -5
- data/lib/jsapi/meta/attributes/type_caster.rb +3 -2
- data/lib/jsapi/meta/base.rb +3 -2
- data/lib/jsapi/meta/base_reference.rb +3 -2
- data/lib/jsapi/meta/definitions.rb +2 -1
- data/lib/jsapi/meta/example/model.rb +1 -2
- data/lib/jsapi/meta/example/reference.rb +0 -1
- data/lib/jsapi/meta/invalid_argument_error.rb +1 -0
- data/lib/jsapi/meta/openapi/callback/model.rb +1 -1
- data/lib/jsapi/meta/openapi/root.rb +8 -8
- data/lib/jsapi/meta/openapi/security_scheme/oauth2.rb +1 -2
- data/lib/jsapi/meta/openapi/security_scheme/open_id_connect.rb +2 -3
- data/lib/jsapi/meta/openapi/security_scheme.rb +2 -2
- data/lib/jsapi/meta/openapi/version.rb +3 -0
- data/lib/jsapi/meta/operation.rb +15 -24
- data/lib/jsapi/meta/parameter/model.rb +5 -3
- data/lib/jsapi/meta/parameter/reference.rb +3 -4
- data/lib/jsapi/meta/property.rb +6 -5
- data/lib/jsapi/meta/request_body/model.rb +2 -1
- data/lib/jsapi/meta/rescue_handler.rb +7 -0
- data/lib/jsapi/meta/response/model.rb +2 -1
- data/lib/jsapi/meta/schema/array.rb +9 -1
- data/lib/jsapi/meta/schema/base.rb +7 -9
- data/lib/jsapi/meta/schema/object.rb +1 -1
- data/lib/jsapi/meta/schema/reference.rb +1 -5
- data/lib/jsapi/meta/schema/string.rb +2 -6
- data/lib/jsapi/meta/schema/validation/maximum.rb +6 -2
- data/lib/jsapi/meta/schema/validation/minimum.rb +6 -2
- data/lib/jsapi/meta/schema/validation/multiple_of.rb +3 -1
- data/lib/jsapi/meta/schema.rb +1 -3
- data/lib/jsapi/model/base.rb +2 -2
- data/lib/jsapi/model/errors.rb +3 -4
- data/lib/jsapi/model/naming.rb +3 -4
- data/lib/jsapi/model/validations.rb +2 -2
- data/lib/jsapi/version.rb +5 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72aa6ad77a99ade6acb3d5c70b6521b640e012cccc7e9ab00b9d55db3062d4d6
|
4
|
+
data.tar.gz: 96ec077740dde1963ca6b448662e1f4370f3bc0b54778db2d03d9447ba69aa3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec7997fbedc7c9035f9e36d5426b23502b87f4c4c654b1e02f93db711f514a8a434d371dc4761156165c439256ad3f339c7a151b1b35c8dcbf3d1e14f1fd4628
|
7
|
+
data.tar.gz: 1f2952e80bf883302fd835f9425bae0bd2e7629b2746d3abec4b19a259c5abbd9869534b18eb6c69afd94a9397e13c7d86d78720f3573d92ef355b1e66b99fb0
|
@@ -10,8 +10,7 @@ module Jsapi
|
|
10
10
|
|
11
11
|
delegate :message, :to_s, to: :@exception
|
12
12
|
|
13
|
-
# Creates a new instance to produce an error response with the given
|
14
|
-
# HTTP status code.
|
13
|
+
# Creates a new instance to produce an error response with the given HTTP status code.
|
15
14
|
def initialize(exception, status:)
|
16
15
|
@exception = exception
|
17
16
|
@status = status
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module Jsapi
|
4
4
|
module Controller
|
5
5
|
module Methods
|
6
|
-
# Returns the Meta::Definitions instance associated with the controller class.
|
7
|
-
#
|
6
|
+
# Returns the Meta::Definitions instance associated with the controller class. In
|
7
|
+
# particular, this method can be used to create an OpenAPI document, for example:
|
8
8
|
#
|
9
9
|
# render(json: api_definitions.openapi_document)
|
10
10
|
#
|
@@ -12,10 +12,10 @@ module Jsapi
|
|
12
12
|
self.class.api_definitions
|
13
13
|
end
|
14
14
|
|
15
|
-
# Performs an API operation by calling the given block. The request parameters
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
15
|
+
# Performs an API operation by calling the given block. The request parameters are
|
16
|
+
# passed as an instance of the operation's model class to the block. The object
|
17
|
+
# returned by the block is implicitly rendered according to the appropriate
|
18
|
+
# +response+ specification.
|
19
19
|
#
|
20
20
|
# api_operation('foo') do |api_params|
|
21
21
|
# # ...
|
@@ -23,10 +23,9 @@ module Jsapi
|
|
23
23
|
#
|
24
24
|
# +operation_name+ can be +nil+ if the controller handles one operation only.
|
25
25
|
#
|
26
|
-
# If +strong+ is +true+, parameters that can be mapped are accepted only.
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# property of the operation.
|
26
|
+
# If +strong+ is +true+, parameters that can be mapped are accepted only. That means
|
27
|
+
# that the model passed to the block is invalid if there are any request parameters
|
28
|
+
# that can't be mapped to a parameter or a request body property of the operation.
|
30
29
|
#
|
31
30
|
def api_operation(operation_name = nil, status: nil, strong: false, &block)
|
32
31
|
_perform_api_operation(
|
@@ -37,8 +36,8 @@ module Jsapi
|
|
37
36
|
)
|
38
37
|
end
|
39
38
|
|
40
|
-
# Like +api_operation+, except that a ParametersInvalid exception is raised
|
41
|
-
#
|
39
|
+
# Like +api_operation+, except that a ParametersInvalid exception is raised on
|
40
|
+
# invalid request parameters.
|
42
41
|
#
|
43
42
|
# api_operation!('foo') do |api_params|
|
44
43
|
# # ...
|
@@ -59,13 +58,11 @@ module Jsapi
|
|
59
58
|
#
|
60
59
|
# +operation_name+ can be +nil+ if the controller handles one operation only.
|
61
60
|
#
|
62
|
-
# If +strong+ is +true+, parameters that can be mapped are accepted only.
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# of the operation.
|
61
|
+
# If +strong+ is +true+, parameters that can be mapped are accepted only. That means
|
62
|
+
# that the model returned is invalid if there are any request parameters that can't be
|
63
|
+
# mapped to a parameter or a request body property of the operation.
|
66
64
|
#
|
67
65
|
# Note that each call of +api_params+ returns a newly created instance.
|
68
|
-
#
|
69
66
|
def api_params(operation_name = nil, strong: false)
|
70
67
|
definitions = api_definitions
|
71
68
|
_api_params(
|
@@ -75,8 +72,8 @@ module Jsapi
|
|
75
72
|
)
|
76
73
|
end
|
77
74
|
|
78
|
-
# Returns a Response to serialize the JSON representation of +result+ according
|
79
|
-
#
|
75
|
+
# Returns a Response to serialize the JSON representation of +result+ according to the
|
76
|
+
# appropriate +response+ specification.
|
80
77
|
#
|
81
78
|
# render(json: api_response(bar, 'foo', status: 200))
|
82
79
|
#
|
@@ -8,13 +8,12 @@ module Jsapi
|
|
8
8
|
|
9
9
|
attr_reader :raw_attributes
|
10
10
|
|
11
|
-
# Creates a new instance that wraps +params+ according to +operation+.
|
12
|
-
#
|
11
|
+
# Creates a new instance that wraps +params+ according to +operation+. References are
|
12
|
+
# resolved to API components in +definitions+.
|
13
13
|
#
|
14
|
-
# If +strong+ is true+ parameters that can be mapped are accepted only.
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# property of +operation+.
|
14
|
+
# If +strong+ is true+ parameters that can be mapped are accepted only. That means that
|
15
|
+
# the instance created is invalid if +params+ contains any parameters that can't be
|
16
|
+
# mapped to a parameter or a request body property of +operation+.
|
18
17
|
def initialize(params, operation, definitions, strong: false)
|
19
18
|
@params = params
|
20
19
|
@strong = strong == true
|
@@ -43,8 +42,8 @@ module Jsapi
|
|
43
42
|
"#{attributes.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')}>"
|
44
43
|
end
|
45
44
|
|
46
|
-
# Validates the request parameters. Returns true if the parameters are
|
47
|
-
#
|
45
|
+
# Validates the request parameters. Returns true if the parameters are valid, false
|
46
|
+
# otherwise. Detected errors are added to +errors+.
|
48
47
|
def validate(errors)
|
49
48
|
[
|
50
49
|
validate_attributes(errors),
|
@@ -11,8 +11,7 @@ module Jsapi
|
|
11
11
|
super('')
|
12
12
|
end
|
13
13
|
|
14
|
-
# Overrides <code>StandardError#message</code> to lazily generate the
|
15
|
-
# error message.
|
14
|
+
# Overrides <code>StandardError#message</code> to lazily generate the error message.
|
16
15
|
def message
|
17
16
|
"#{
|
18
17
|
@params.errors.full_messages.map do |message|
|
@@ -5,8 +5,8 @@ module Jsapi
|
|
5
5
|
# Used to serialize a response.
|
6
6
|
class Response
|
7
7
|
|
8
|
-
# Creates a new instance to serialize +object+ according to +response+.
|
9
|
-
#
|
8
|
+
# Creates a new instance to serialize +object+ according to +response+. References are
|
9
|
+
# resolved to API components in +definitions+.
|
10
10
|
def initialize(object, response, definitions)
|
11
11
|
@object = object
|
12
12
|
@response = response
|
@@ -71,6 +71,8 @@ module Jsapi
|
|
71
71
|
object.to_date
|
72
72
|
when 'date-time'
|
73
73
|
object.to_datetime
|
74
|
+
when 'duration'
|
75
|
+
object.iso8601
|
74
76
|
else
|
75
77
|
object.to_s
|
76
78
|
end
|
data/lib/jsapi/dsl/callbacks.rb
CHANGED
@@ -12,7 +12,7 @@ module Jsapi
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
# Defines the root of an OpenAPI document.
|
15
|
+
# Defines the root of an \OpenAPI document.
|
16
16
|
#
|
17
17
|
# openapi do
|
18
18
|
# info title: 'Foo', version: '1'
|
@@ -63,8 +63,8 @@ module Jsapi
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
# Specifies the HTTP status code of an error response rendered when an
|
67
|
-
#
|
66
|
+
# Specifies the HTTP status code of an error response rendered when an exception of
|
67
|
+
# any of +klasses+ has been raised.
|
68
68
|
#
|
69
69
|
# rescue_from Jsapi::Controller::ParametersInvalid, with: 400
|
70
70
|
#
|
data/lib/jsapi/dsl/error.rb
CHANGED
@@ -5,8 +5,7 @@ module Jsapi
|
|
5
5
|
# Raised when an error occurred while defining an API component.
|
6
6
|
class Error < StandardError
|
7
7
|
|
8
|
-
# Creates a new error. +origin+ is the innermost position at where
|
9
|
-
# the error occurred.
|
8
|
+
# Creates a new error. +origin+ is the innermost position at where the error occurred.
|
10
9
|
def initialize(error_or_message, origin = nil)
|
11
10
|
@path = Array(origin)
|
12
11
|
super(
|
@@ -18,9 +17,8 @@ module Jsapi
|
|
18
17
|
)
|
19
18
|
end
|
20
19
|
|
21
|
-
# Overrides <code>StandardError#message</code> to append the whole path of
|
22
|
-
#
|
23
|
-
# <code>{message} (at foo / bar)</code>.
|
20
|
+
# Overrides <code>StandardError#message</code> to append the whole path of the position
|
21
|
+
# at where the error occurred, for example: <code>{message} (at foo / bar)</code>.
|
24
22
|
def message
|
25
23
|
message = super
|
26
24
|
return message if @path.empty?
|
data/lib/jsapi/dsl/examples.rb
CHANGED
@@ -3,9 +3,123 @@
|
|
3
3
|
module Jsapi
|
4
4
|
module DSL
|
5
5
|
module OpenAPI
|
6
|
-
# Used to specify details of an OpenAPI object.
|
6
|
+
# Used to specify details of an \OpenAPI object.
|
7
7
|
class Root < Node
|
8
8
|
include Callbacks
|
9
|
+
|
10
|
+
##
|
11
|
+
# :method: base_path
|
12
|
+
# :args: arg
|
13
|
+
# Specifies the base path of the API.
|
14
|
+
#
|
15
|
+
# base_path '/foo'
|
16
|
+
#
|
17
|
+
# See Meta::OpenAPI::Root#base_path for further information.
|
18
|
+
|
19
|
+
##
|
20
|
+
# :method: consumes
|
21
|
+
# :args: mime_types
|
22
|
+
# Specifies one or more MIME types the API can consume.
|
23
|
+
#
|
24
|
+
# consumes 'application/json'
|
25
|
+
#
|
26
|
+
# consumes %w[application/json application/pdf]
|
27
|
+
#
|
28
|
+
# See Meta::OpenAPI::Root#consumes for further information.
|
29
|
+
|
30
|
+
##
|
31
|
+
# :method: external_docs
|
32
|
+
# :args: **keywords, &block
|
33
|
+
# Specifies the external documentation.
|
34
|
+
#
|
35
|
+
# external_docs url: 'https://foo.bar'
|
36
|
+
#
|
37
|
+
# See Meta::OpenAPI::Root#external_docs for further information.
|
38
|
+
|
39
|
+
##
|
40
|
+
# :method: host
|
41
|
+
# :args: arg
|
42
|
+
# Specifies the host serving the API.
|
43
|
+
#
|
44
|
+
# host 'foo.bar'
|
45
|
+
#
|
46
|
+
# See Meta::OpenAPI::Root#host for further information.
|
47
|
+
|
48
|
+
##
|
49
|
+
# :method: info
|
50
|
+
# :args: **keywords, &block
|
51
|
+
# Specifies general information about the API.
|
52
|
+
#
|
53
|
+
# info title: 'foo', version: 1
|
54
|
+
#
|
55
|
+
# See Meta::OpenAPI::Root#info for further information.
|
56
|
+
|
57
|
+
##
|
58
|
+
# :method: link
|
59
|
+
# :args: name, **keywords, &block
|
60
|
+
# Adds a link.
|
61
|
+
#
|
62
|
+
# link 'foo', operation_id: 'bar'
|
63
|
+
#
|
64
|
+
# See Meta::OpenAPI::Root#links for further information.
|
65
|
+
|
66
|
+
##
|
67
|
+
# :method: produces
|
68
|
+
# :args: mime_types
|
69
|
+
# Specifies one or more MIME types the API can produce.
|
70
|
+
#
|
71
|
+
# produces 'application/json'
|
72
|
+
#
|
73
|
+
# produces %w[application/json application/pdf]'
|
74
|
+
#
|
75
|
+
# See Meta::OpenAPI::Root#produces for further information.
|
76
|
+
|
77
|
+
##
|
78
|
+
# :method: scheme
|
79
|
+
# :args: arg
|
80
|
+
# Adds a URI scheme supported by the API.
|
81
|
+
#
|
82
|
+
# scheme 'https'
|
83
|
+
#
|
84
|
+
# See Meta::OpenAPI::Root#scheme for further information.
|
85
|
+
|
86
|
+
##
|
87
|
+
# :method: security_requirement
|
88
|
+
# :args: **keywords, &block
|
89
|
+
# Adds a security requirement.
|
90
|
+
#
|
91
|
+
# security_requirement do
|
92
|
+
# scheme 'basic_auth'
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# See Meta::OpenAPI::Root#security_requirements for further information.
|
96
|
+
|
97
|
+
##
|
98
|
+
# :method: security_scheme
|
99
|
+
# :args: name, **keywords, &block
|
100
|
+
# Adds a security scheme.
|
101
|
+
#
|
102
|
+
# security_scheme 'basic_auth', type: 'http', scheme: 'basic'
|
103
|
+
#
|
104
|
+
# See Meta::OpenAPI::Root#security_schemes for further information.
|
105
|
+
|
106
|
+
##
|
107
|
+
# :method: server
|
108
|
+
# :args: arg
|
109
|
+
# Adds a server providing the API.
|
110
|
+
#
|
111
|
+
# server url: 'https://foo.bar'
|
112
|
+
#
|
113
|
+
# See Meta::OpenAPI::Root#servers for further information.
|
114
|
+
|
115
|
+
##
|
116
|
+
# :method: tag
|
117
|
+
# :args: **keywords, &block
|
118
|
+
# Adds a tag.
|
119
|
+
#
|
120
|
+
# tag name: 'foo', description: 'description of foo'
|
121
|
+
#
|
122
|
+
# See Meta::OpenAPI::Root#tags for further information.
|
9
123
|
end
|
10
124
|
end
|
11
125
|
end
|
data/lib/jsapi/dsl/operation.rb
CHANGED
@@ -6,12 +6,28 @@ module Jsapi
|
|
6
6
|
class Operation < Node
|
7
7
|
include Callbacks
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
##
|
10
|
+
# :method: deprecated
|
11
|
+
# :args: arg
|
12
|
+
# Specifies whether or not the operation is deprecated.
|
13
|
+
#
|
14
|
+
# deprecated true
|
15
|
+
|
16
|
+
##
|
17
|
+
# :method: description
|
18
|
+
# :args: arg
|
19
|
+
# Specifies the description of the operation.
|
20
|
+
|
21
|
+
# Specifies the HTTP verb of the operation.
|
22
|
+
#
|
23
|
+
# method 'post'
|
24
|
+
#
|
25
|
+
# See Meta::Operation#method for further information.
|
26
|
+
def method(arg)
|
27
|
+
_keyword(:method, arg)
|
12
28
|
end
|
13
29
|
|
14
|
-
#
|
30
|
+
# Defines the model class to access top-level parameters by.
|
15
31
|
#
|
16
32
|
# model Foo do
|
17
33
|
# def bar
|
@@ -19,9 +35,8 @@ module Jsapi
|
|
19
35
|
# end
|
20
36
|
# end
|
21
37
|
#
|
22
|
-
# +klass+ can be any subclass of Model::Base. If block is given, an
|
23
|
-
#
|
24
|
-
# Model::Base.
|
38
|
+
# +klass+ can be any subclass of Model::Base. If block is given, an anonymous class
|
39
|
+
# is created that inherits either from +klass+ or Model::Base.
|
25
40
|
def model(klass = nil, &block)
|
26
41
|
if block
|
27
42
|
klass = Class.new(klass || Model::Base)
|
@@ -30,7 +45,7 @@ module Jsapi
|
|
30
45
|
_meta_model.model = klass
|
31
46
|
end
|
32
47
|
|
33
|
-
#
|
48
|
+
# Adds a parameter or a reference to a reusable parameter.
|
34
49
|
#
|
35
50
|
# # define a parameter
|
36
51
|
# parameter 'foo', type: 'string'
|
@@ -43,8 +58,8 @@ module Jsapi
|
|
43
58
|
# # refer a reusable parameter
|
44
59
|
# parameter ref: 'foo'
|
45
60
|
#
|
46
|
-
# Refers the reusable parameter with the same name if neither any
|
47
|
-
#
|
61
|
+
# Refers the reusable parameter with the same name if neither any keywords nor a
|
62
|
+
# block is specified.
|
48
63
|
#
|
49
64
|
# parameter 'foo'
|
50
65
|
#
|
@@ -58,6 +73,11 @@ module Jsapi
|
|
58
73
|
end
|
59
74
|
end
|
60
75
|
|
76
|
+
##
|
77
|
+
# :method: path
|
78
|
+
# :args: arg
|
79
|
+
# Specifies the relative path of the operation.
|
80
|
+
|
61
81
|
# Defines the request body or refers a reusable request body.
|
62
82
|
#
|
63
83
|
# # define a request body
|
@@ -80,7 +100,7 @@ module Jsapi
|
|
80
100
|
end
|
81
101
|
end
|
82
102
|
|
83
|
-
#
|
103
|
+
# Adds a response or a reference to a reusable response.
|
84
104
|
#
|
85
105
|
# # define a response
|
86
106
|
# response 200, type: 'object' do
|
@@ -113,6 +133,25 @@ module Jsapi
|
|
113
133
|
_eval(response_model, Response, &block)
|
114
134
|
end
|
115
135
|
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# :method: summary
|
139
|
+
# :args: arg
|
140
|
+
# Specifies the short summary of the operation.
|
141
|
+
|
142
|
+
##
|
143
|
+
# :method: tag
|
144
|
+
# :args: name
|
145
|
+
# Adds a tag.
|
146
|
+
#
|
147
|
+
# tag 'foo'
|
148
|
+
|
149
|
+
##
|
150
|
+
# :method: tags
|
151
|
+
# :args: names
|
152
|
+
# Specifies all of the tags at once.
|
153
|
+
#
|
154
|
+
# tags %w[foo bar]
|
116
155
|
end
|
117
156
|
end
|
118
157
|
end
|
data/lib/jsapi/dsl/parameter.rb
CHANGED
@@ -5,6 +5,25 @@ module Jsapi
|
|
5
5
|
# Used to specify details of a parameter.
|
6
6
|
class Parameter < Schema
|
7
7
|
include Examples
|
8
|
+
|
9
|
+
##
|
10
|
+
# :method: deprecated
|
11
|
+
# :args: arg
|
12
|
+
# Specifies whether or not the parameter is deprecated.
|
13
|
+
#
|
14
|
+
# deprecated true
|
15
|
+
|
16
|
+
##
|
17
|
+
# :method: description
|
18
|
+
# :args: arg
|
19
|
+
# Specifies the description of the parameter.
|
20
|
+
|
21
|
+
##
|
22
|
+
# :method: in
|
23
|
+
# :args: location
|
24
|
+
# Specifies the location of the parameter.
|
25
|
+
#
|
26
|
+
# See Meta::Parameter::Model#in for further information.
|
8
27
|
end
|
9
28
|
end
|
10
29
|
end
|
@@ -5,6 +5,18 @@ module Jsapi
|
|
5
5
|
# Used to specify details of a request body.
|
6
6
|
class RequestBody < Schema
|
7
7
|
include Examples
|
8
|
+
|
9
|
+
##
|
10
|
+
# :method: deprecated
|
11
|
+
# :args: arg
|
12
|
+
# Specifies whether or not the request body is deprecated.
|
13
|
+
#
|
14
|
+
# deprecated true
|
15
|
+
|
16
|
+
##
|
17
|
+
# :method: description
|
18
|
+
# :args: arg
|
19
|
+
# Specifies the description of the request body.
|
8
20
|
end
|
9
21
|
end
|
10
22
|
end
|
data/lib/jsapi/dsl/response.rb
CHANGED
@@ -6,6 +6,18 @@ module Jsapi
|
|
6
6
|
class Response < Schema
|
7
7
|
include Examples
|
8
8
|
|
9
|
+
##
|
10
|
+
# :method: deprecated
|
11
|
+
# :args: arg
|
12
|
+
# Specifies whether or not the response is deprecated.
|
13
|
+
#
|
14
|
+
# deprecated true
|
15
|
+
|
16
|
+
##
|
17
|
+
# :method: description
|
18
|
+
# :args: arg
|
19
|
+
# Specifies the description of the response.
|
20
|
+
|
9
21
|
# Defines a link or refers a reusable link object.
|
10
22
|
#
|
11
23
|
# # define a link
|
@@ -28,6 +40,13 @@ module Jsapi
|
|
28
40
|
Node.new(link_model, &block) if block
|
29
41
|
end
|
30
42
|
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# :method: locale
|
46
|
+
# :args: arg
|
47
|
+
# Specifies the locale to be used when rendering a response.
|
48
|
+
#
|
49
|
+
# locale :en
|
31
50
|
end
|
32
51
|
end
|
33
52
|
end
|