Skip to content

Commit ed39372

Browse files
authored
Merge pull request ota42y#145 from muhammadn/feat/info
add info
2 parents 8464df8 + 3fb80d6 commit ed39372

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

lib/openapi_parser/schemas.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
require_relative 'schemas/media_type'
1616
require_relative 'schemas/schema'
1717
require_relative 'schemas/header'
18+
require_relative 'schemas/info'

lib/openapi_parser/schemas/classes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ class MediaType < Base; end
1616
class Schema < Base; end
1717
class Components < Base; end
1818
class Header < Base; end
19+
class Info < Base; end
1920
end

lib/openapi_parser/schemas/info.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module OpenAPIParser::Schemas
2+
class Info < Base
3+
4+
openapi_attr_values :title, :version
5+
end
6+
end

lib/openapi_parser/schemas/openapi.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def initialize(raw_schema, config, uri: nil, schema_registry: {})
2929
# @return [Components, nil]
3030
openapi_attr_object :components, Components, reference: false
3131

32+
# @!attribute [r] info
33+
# @return [Info, nil]
34+
openapi_attr_object :info, Info, reference: false
35+
3236
# @return [OpenAPIParser::RequestOperation, nil]
3337
def request_operation(http_method, request_path)
3438
OpenAPIParser::RequestOperation.create(http_method, request_path, @path_item_finder, @config)

0 commit comments

Comments
 (0)