This repository was archived by the owner on Sep 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
This repository was archived by the owner on Sep 14, 2019. It is now read-only.
Implement API endpoint for documentation retrieval #443
Copy link
Copy link
Open
Labels
C-FeatureCategory: Issues containing feature requests that aren't modulesCategory: Issues containing feature requests that aren't modulesD-EasyDifficulty: Issues that should be relatively easy to resolveDifficulty: Issues that should be relatively easy to resolveE-MentorCall for participation: Issues that have mentors availableCall for participation: Issues that have mentors availableMIG-ClientComponent: Issues concerning the MIG clientsComponent: Issues concerning the MIG clientsP-LowPriority: Issues that can afford to be resolved when it is convenient to do soPriority: Issues that can afford to be resolved when it is convenient to do so
Milestone
Description
Dependent on #442.
Ideally, what we'd like (to start) are data structures representing the request and response data types for each of the endpoints we'll support. Each structure may implement some interface to provide self-documentation that can be aggregated and served as JSON.
The following example sketches this approach:
type SelfDocumenting interface {
Documentation() APIDocumentation
}
type APIDocumentation struct {
Method string `json:"method"`
Route string `json:"route"`
// ...
}
type ReqActionStatus struct {
ActionID string
}
func (req ReqActionStatus) Documentation() APIDocumentation {
return APIDocumentation {
Method: "GET",
Route: "/v1/actions/:id/status",
// ...
}
}The above could be expanded upon to include something like an Endpoint struct containing empty instances of a request and response type, so that we can start composing these structs to get complete documentation for each endpoint. Serving this information would then simply be a matter of constructing a big nested collection of APIDocumentations, encoding that to JSON, and serving it to the user.
Metadata
Metadata
Assignees
Labels
C-FeatureCategory: Issues containing feature requests that aren't modulesCategory: Issues containing feature requests that aren't modulesD-EasyDifficulty: Issues that should be relatively easy to resolveDifficulty: Issues that should be relatively easy to resolveE-MentorCall for participation: Issues that have mentors availableCall for participation: Issues that have mentors availableMIG-ClientComponent: Issues concerning the MIG clientsComponent: Issues concerning the MIG clientsP-LowPriority: Issues that can afford to be resolved when it is convenient to do soPriority: Issues that can afford to be resolved when it is convenient to do so