Skip to content

Initialize swagger checker from swagger object directly#106

Closed
ben-axnick wants to merge 1 commit intowestfieldlabs:masterfrom
flippa:100_support_multiple_loading_methods
Closed

Initialize swagger checker from swagger object directly#106
ben-axnick wants to merge 1 commit intowestfieldlabs:masterfrom
flippa:100_support_multiple_loading_methods

Conversation

@ben-axnick
Copy link
Copy Markdown

Intended to address: #100

Background

Currently the SwaggerChecker initialize method has no flexibility about how Apivore::Swagger is constructed. By accepting a full object, the client gains the flexibility to fetch a swagger file however it wishes to, whether by file, remote HTTPS, or carrier pigeon.

Since README and specs revolve around .instance_for, whose signature remains unchanged, there are no other changes required.

What have I done?

  • The previous initialization routine has been moved to .from_local_route, and .instance_for has been updated to reflect that.
  • The new initializer accepts a Apivore::Swagger (or any object that accepts #validate and #each_response)

Currently the initialize method has no flexibility about how
Apivore::Swagger is constructed. By accepting a full
object, the client gains the flexibility to fetch a swagger file however
it wishes to.

The previous initalization routine has been moved to
`.from_local_route`, and `.instance_for` has been updated to reflect
that.

Any client that previously used the initializer directly would need to
be modified to call `.from_local_route` instead.
@ben-axnick
Copy link
Copy Markdown
Author

Closing because I don't want to see this in my PR list forever.

If you're interested in merging down the line, I'm happy to help make any changes you feel need to be made.

@ben-axnick ben-axnick closed this May 26, 2017
@ben-axnick ben-axnick deleted the 100_support_multiple_loading_methods branch May 26, 2017 04:25
@philsturgeon
Copy link
Copy Markdown

Wish I saw this before making #118. If there is interest from the maintainers about that PR I'll pull this in and tweak it a little. I'm unhappy with the two-different places to check if JSON/YAML.

@ben-axnick
Copy link
Copy Markdown
Author

Yeah, I had closed owing to the fact that it seemed like PRs weren't being handled or looked into at all by the maintainers, hopefully your PR meets with greater success.

@philsturgeon
Copy link
Copy Markdown

philsturgeon commented Nov 21, 2017 via email

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.

2 participants