Skip to content
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

GTD-2: API reference improvements #48

Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d6358f3
Moved rendering into a separate class
lewisnyman Aug 23, 2018
ae6b562
Move operations rendering into a seperate file
lewisnyman Aug 23, 2018
0a59bd0
Moved paramters rendering into a seperate file
lewisnyman Aug 23, 2018
4e27939
Moved responses rendering into a seperate file
lewisnyman Aug 23, 2018
b054506
Add support for enum type in parameters
mikebell Aug 28, 2018
e21bec7
Fix inserting schema objects with api_schema>
mikebell Aug 28, 2018
dabc682
Render schemas below an individual path
lewisnyman Aug 28, 2018
fdbdbc8
Add paragraph tags to enum parameters
lewisnyman Aug 29, 2018
d134307
Add schema link support to nested schema objects. Move functionality …
lewisnyman Aug 29, 2018
8156fa8
Also print schema links to reference within schema array properties
lewisnyman Aug 29, 2018
38b3af1
Add start of json response output
mikebell Aug 29, 2018
35b2386
Simplified the json output generation for the response body
lewisnyman Aug 29, 2018
0d7599f
Lovely pretty JSON
lewisnyman Aug 29, 2018
b601b4e
Display referenced data structures in response bodies
lewisnyman Aug 30, 2018
b315d2d
Remove extra table row and space
mikebell Aug 30, 2018
0b229ec
Support array type in responses
mikebell Aug 30, 2018
61f9b97
Prevented response bodies from breaking page layout
lewisnyman Aug 30, 2018
fd28f5f
Printed nested references to schemas, currently one level deep
lewisnyman Aug 30, 2018
b6cc92f
Recursively render schemas referenced by other schemas referenced by …
lewisnyman Aug 30, 2018
369ae2b
Start of allOf support
mikebell Aug 30, 2018
4a2804c
Merge branch 'json-response-output' of github.com:ConvivioTeam/tech-d…
mikebell Aug 30, 2018
66cb0e6
Render AllOf properties
lewisnyman Aug 30, 2018
8ccf86e
Do not print schema links of properties of referenced schema objects
lewisnyman Aug 30, 2018
31c02fd
Print schema objects referenced in arrays for single paths
lewisnyman Aug 30, 2018
aaef8d5
Add AllOf support to schemas referenced by a single printed path
lewisnyman Aug 30, 2018
b51feec
Support example responses inline
mikebell Sep 6, 2018
f593b79
Pretty print example response
mikebell Sep 6, 2018
aa920b3
Add support for markdown in response descriptions
mikebell Sep 6, 2018
ff44e27
Correctly render nested array and items, with allOf support, in respo…
lewisnyman Sep 6, 2018
5a08292
Merge branch 'json-response-output' into GTD-2-api-reference-improvem…
mikebell Sep 6, 2018
a93c41f
Fixed the rendering of schemas on a single path, the template expects…
lewisnyman Sep 6, 2018
89aa8a1
Fixed linting errors
lewisnyman Sep 6, 2018
b2ce26b
Update tests
lewisnyman Sep 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/govuk_tech_docs/api_reference/api_reference_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ def schemas_from_path(text)

def schemas_from_schema(schema)
schemas = []
properties = schema.properties
properties.each do |key, property|
properties = []
schema.properties.each do |property|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is schema.properties a hash? If so you can just do properties = schema.properties.values.

properties.push property[1]
end
if schema.type == 'array'
properties.push schema.items
end
properties.each do |property|
# Must be a schema be referenced by another schema
# And not a property of a schema
if property.node_context.referenced_by.to_s.include? '#/components/schemas' and !property.node_context.source_location.to_s.include? '/properties/'
Expand Down