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

Custom header support during reload: closes #60 #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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
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

1 participant