Skip to content

Commit

Permalink
Merge pull request #145 from muhammadn/feat/info
Browse files Browse the repository at this point in the history
add info
  • Loading branch information
ota42y authored Feb 23, 2023
2 parents 8464df8 + 3fb80d6 commit ed39372
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/openapi_parser/schemas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
require_relative 'schemas/media_type'
require_relative 'schemas/schema'
require_relative 'schemas/header'
require_relative 'schemas/info'
1 change: 1 addition & 0 deletions lib/openapi_parser/schemas/classes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ class MediaType < Base; end
class Schema < Base; end
class Components < Base; end
class Header < Base; end
class Info < Base; end
end
6 changes: 6 additions & 0 deletions lib/openapi_parser/schemas/info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module OpenAPIParser::Schemas
class Info < Base

openapi_attr_values :title, :version
end
end
4 changes: 4 additions & 0 deletions lib/openapi_parser/schemas/openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def initialize(raw_schema, config, uri: nil, schema_registry: {})
# @return [Components, nil]
openapi_attr_object :components, Components, reference: false

# @!attribute [r] info
# @return [Info, nil]
openapi_attr_object :info, Info, reference: false

# @return [OpenAPIParser::RequestOperation, nil]
def request_operation(http_method, request_path)
OpenAPIParser::RequestOperation.create(http_method, request_path, @path_item_finder, @config)
Expand Down

0 comments on commit ed39372

Please sign in to comment.