Skip to content

Conversation

@cboitel
Copy link

@cboitel cboitel commented Feb 6, 2020

Main changes made:

  • loading is now performed in a common func to watch/__reload
  • align messages on console when reloading from watch or __reload

Tests OK

2020/02/06 10:41:17 GET /test (Test) => 200 (application/json)
2020/02/06 10:41:17 GET /test (Test) => 200 (application/vnd.test-api+json)
2020/02/06 10:41:17 GET /test (Test) => 200 (application/yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (application/x-yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (application/vnd.test-api+yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (text/yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (text/x-yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (text/vnd.test-api+yaml)
2020/02/06 10:41:17 GET /test (Test) => 200 (text/vnd.test-api+xml)
2020/02/06 10:41:17 Cannot marshal as 'text/vnd.test-api+xml'!
2020/02/06 10:41:17 GET /test (Test) => 200 (application/json-with-extensions)
2020/02/06 10:41:17 Cannot marshal as 'application/json-with-extensions'!
PASS
ok      github.com/danielgtaylor/apisprout      0.414s

Manual tests (on Windows):

  • use an invalid local or http swagger file
    • displays error and exists
  • use a local swagger file and enable watch on it
    • change file => reloading occurs and succeeds
    • rename file => reloading occurs and fails but original API keeps on being served
    • rename back file => reloading occurs and succeeds
    • change file again after renames => reloading occurs and succeeds
  • use a HTTP swagger file with custom header
    • initial load ok
    • call __reload: reload occurs and succeeds
    • file moved on server and __reload called: reloading occurs and fails but original API keeps on being served
    • file moved back on server and __reload called: reloading occurs and succeeds

@cboitel cboitel changed the title Cboitel customheaderduringreload Custom header support during reload: closes #60 Feb 6, 2020
@cboitel cboitel requested a review from danielgtaylor February 6, 2020 10:10
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.

1 participant