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

Adding documentation override system #551

Merged
merged 1 commit into from Apr 23, 2015
Merged

Adding documentation override system #551

merged 1 commit into from Apr 23, 2015

Conversation

mtdowling
Copy link
Member

This PR adds a documentation override system that allows us to modify the generated service docs for API clients by version.

Each client has a static applyDocFilters method which accepts an array of service and docs data and returns an array of service and doc data. This function can then change the data it is passed to add in parameters or modify documentation.

In order to easily achieve this, I've refactored the Service class to accept the data as an argument instead of having to invoke the provided api provider to get the service data. This not only simplified the code and mocking service's, it made filtering docs in this way possible.

In order to generate docs, I needed a way to map the endpointPrefix to the service namespace. I did this by calculating the namespace when generating the api manifest. I moved the list of versions into a "versions" key and added a top level "namespace" key. This allows us to get the namespace of a client and call the corresponding applyDocFilters method. Because it's no longer just a version manifest, I renamed the file to "manifest.json".

@jeremeamia
Copy link
Contributor

🚢

mtdowling added a commit that referenced this pull request Apr 23, 2015
Adding documentation override system
@mtdowling mtdowling merged commit f2656fd into v3 Apr 23, 2015
@mtdowling mtdowling deleted the doc-overrides branch April 23, 2015 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants