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

swagger files for the servers #1

Merged
merged 3 commits into from
Dec 7, 2018

Conversation

TeodoroFilippini
Copy link
Contributor

@mristin

Let me know what you think of these Swagger files for the two MailGun Relayery servers. I am unsure about the term "instance" to refer to someone pushing to the Forward Server - do you have a better term in mind?
Also, notice this branch merges to first-version and not master; I thought we could split the tool in several PRs to avoid large, blocking code review sessions.

Copy link
Contributor

@mristin mristin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you were a bit confused with instances running the pipeline and channels -- the mailgun relayery does not know anything about the instances; it only needs to forward the messages (think of it as a proxy for email).

I hope the comments could clarify it a bit? Otherwise, if it's still not clear, let's have a look at it off-line in more detail today in the office.

Re merging to first-version: good idea!

swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/forward/swagger.yaml Outdated Show resolved Hide resolved
swagger/forward/swagger.yaml Outdated Show resolved Hide resolved
swagger/forward/swagger.yaml Outdated Show resolved Hide resolved
swagger/forward/swagger.yaml Outdated Show resolved Hide resolved
swagger/forward/swagger.yaml Outdated Show resolved Hide resolved
@TeodoroFilippini TeodoroFilippini force-pushed the swagger-server-files branch 2 times, most recently from 670792e to b3f9dd0 Compare December 4, 2018 16:37
@TeodoroFilippini
Copy link
Contributor Author

TeodoroFilippini commented Dec 4, 2018

@mristin here's the updated Swaggers. LMK what you think!

Copy link
Contributor

@mristin mristin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good now! The token definition seems invalid in the relay API; please also see the minor remarks.

swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
swagger/control/swagger.yaml Outdated Show resolved Hide resolved
type: array
items:
$ref: "#/definitions/Channel"
rels:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are not including the rels in the header, why not just include the property "pages" here?

description: contains a URL.
type: string

Rels:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rels are actually expected in the header. Since you are including them in the response body (and not response header), you can do away with OptionalRel and just set prev and next as not required fields, couldn't you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think that's the way to go? Otherwise I can set all rels in the header directly in the code and perhaps only mention their existance in the swagger description of the ChannelsPage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using rels in the headers (hypermedia link relations) is not trivial to implement in the client (and it seems it's not set yet, see OAI/OpenAPI-Specification#688).

I'd go for the easier solution that I suggested since we could already use swagger-to to generate the client(s).

swagger/relay/swagger.yaml Outdated Show resolved Hide resolved
@TeodoroFilippini
Copy link
Contributor Author

TeodoroFilippini commented Dec 7, 2018

@mristin please take a last look at the ChannelsPage object in the control swagger, and if it's okay I'll go ahead and merge.

- per_page
- channels
- rels
- prev
Copy link
Contributor

@mristin mristin Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you already added page_count, I think that prev and next are now obsolete since the client needs to iterate over page_count specifying the page parameter in list_channels endpoint.

@TeodoroFilippini TeodoroFilippini merged commit b38293f into first-version Dec 7, 2018
@TeodoroFilippini TeodoroFilippini deleted the swagger-server-files branch December 7, 2018 10:25
TeodoroFilippini added a commit that referenced this pull request Dec 7, 2018
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