-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix examples generation #77
base: master
Are you sure you want to change the base?
Conversation
|
||
{ name => value } | ||
end | ||
[ name, value ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceInsideArrayLiteralBrackets: Do not use space inside array brackets.
lib/oas_objs/param_obj.rb
Outdated
desc = schema.processed[:description] | ||
processed[:description] = desc if desc | ||
processed[:description] = processed[:schema].delete(:description) if processed[:schema].key?(:description) | ||
processed[:examples] = processed[:schema].delete(:examples) if processed[:schema].key?(:examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [105/80]
lib/oas_objs/param_obj.rb
Outdated
@@ -21,8 +21,8 @@ def initialize(name, param_type, type, required, schema) | |||
|
|||
def process | |||
processed[:schema] = schema.process | |||
desc = schema.processed[:description] | |||
processed[:description] = desc if desc | |||
processed[:description] = processed[:schema].delete(:description) if processed[:schema].key?(:description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [114/80]
@@ -31,7 +31,7 @@ def clear | |||
|
|||
desc :example, subject: :examples do | |||
mk -> { example :ExampleA, { }; example :ExampleZ, { } }, doc_will_has_keys: { examples: %i[ ExampleA ExampleZ ] }; clear | |||
mk -> { example :ExampleA, { name: 'BeiGou' } }, get: { ExampleA: [{ name: { value: 'BeiGou' } }] } | |||
mk -> { example :ExampleA, { name: 'BeiGou' } }, get: { ExampleA: { name: { value: 'BeiGou' } } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.
Metrics/LineLength: Line is too long. [101/80]
During generating examples for query param, I stepped on the fact, that while |
processed | ||
end | ||
|
||
def name | ||
processed[:name] | ||
end | ||
|
||
def extract_from_schema(key) | ||
processed[key] = processed[:schema].delete(key) if processed[:schema].key?(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [87/80]
Examples should have different location and format according to OAS 3.0.