-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Added OpenAPI documentation. * Updated class and module structure to be more accurate. * Added document transfer endpoint with support for url sources and onedrive destinations. * Added reusable response entities. * Added additional documentation for the API.
- Loading branch information
1 parent
8b51dba
commit 06b4c4f
Showing
49 changed files
with
1,435 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--require spec_helper.rb | ||
--color | ||
--format RSpec::Github::Formatter | ||
--format documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
require: | ||
- rubocop-factory_bot | ||
- rubocop-rake | ||
- rubocop-rspec | ||
|
||
AllCops: | ||
NewCops: enable | ||
SuggestExtensions: true | ||
|
||
# Transient properties get mistaken for associations in FactoryBot. | ||
# See https://github.com/rubocop/rubocop-factory_bot/issues/73 | ||
FactoryBot/FactoryAssociationWithStrategy: | ||
Enabled: false | ||
|
||
# Count multi-line hashes and arrays in examples as one line. | ||
RSpec/ExampleLength: | ||
CountAsOne: | ||
- array | ||
- hash | ||
|
||
Metrics/BlockLength: | ||
AllowedMethods: | ||
# Exclude grape `resource` blocks. | ||
- resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Document Transfer Service API | ||
|
||
Interacting with the Document Transfer Service is done through a RESTful API. | ||
All requests and responses should be in JSON format, unless otherwise indicated. | ||
|
||
Full API documentation can be found in the [OpenAPI specification][spec]. | ||
|
||
## GET /health | ||
|
||
A basic health endpoint that will return a 200 status code if the API is | ||
running. | ||
|
||
_Note: This endpoint does not require authentication._ | ||
|
||
Example response: | ||
|
||
```json | ||
{ "status": "ok" } | ||
``` | ||
|
||
## POST /transfer | ||
|
||
Initiate a document transfer. This is a synchronous request that will return | ||
once the transfer is complete or a failure occurs. | ||
|
||
The required parameters for this request will vary based on the [source] and | ||
[destination] types. | ||
|
||
Successful requests will always include a `status` and `destination` field. | ||
Additional fields may be included based on the destination type. | ||
|
||
### Example request | ||
|
||
```json | ||
{ | ||
"source": { | ||
"type": "url", | ||
"url": "https://example.com/document.pdf" | ||
}, | ||
"destination": { | ||
"type": "onedrive", | ||
"path": "/document/path" | ||
} | ||
} | ||
``` | ||
|
||
### Example response: | ||
|
||
```json | ||
{ | ||
"status": "success", | ||
"destination": "onedrive", | ||
"path": "/document/path/document.pdf" | ||
} | ||
``` | ||
|
||
[destination]: destinations.md | ||
[source]: sources.md | ||
[spec]: ../openapi.yaml |
Oops, something went wrong.