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

Update specs to OpenAPI 3.0.1 #1120

Merged
merged 1 commit into from
May 29, 2019
Merged

Update specs to OpenAPI 3.0.1 #1120

merged 1 commit into from
May 29, 2019

Conversation

clarakosi
Copy link
Member

@clarakosi clarakosi commented Apr 17, 2019

Dependent on Hyperswitch PR

I should’ve caught this earlier but the online swagger validator we were using does not support v3.

Instead of waiting for swagger-cli to update its dependency (swagger-parser using openapi-schema-validation v0.4.2 instead of v3.0.3) I’ve elected to use openapi-schema-validation v3.0.3 directly. I am open to other suggestions.

Summary of major changes in v3:

  1. swagger: 2.0 has been replaced with openapi: 3.0.1
    1. https://swagger.io/docs/specification/basic-structure/
  2. definitions was renamed to schemas and securityDefinitions  to securitySchemes and they all were moved inside components
    1. https://swagger.io/docs/specification/components/
  3. servers replaces the basePath keywords used in OpenAPI 2.0
    1. ISSUE/ Additional work: Service checker expects a basePath. It needs to be updated to also look for servers[0].url
    2. https://github.com/wikimedia/operations-software-service-checker/blob/master/servicechecker/swagger.py#L109
  4. produces replaced with content in response. Must include media type & schema.
    1. https://swagger.io/docs/specification/media-types/
  5. Examples in request parameters are back (originally removed when converting to v2.0)
  6. consumes has been replaced with requestBody
    1. https://swagger.io/docs/specification/describing-request-body/
  7. Data type: File has been replace with type: string, format: binary
    1. https://swagger.io/docs/specification/data-models/data-types/
  8. Reordering of type in parameters to show up under schema

Unclear/ Need help:
I’m not fully sure how redirect works in the codebase. For example, with html/{title} && html/{title}/{revision} we have it accepting a boolean (in spec) but some of the tests are providing the value no to the query. I’ve gone through some of the code in sys/ but I am having a hard time tracking it down.

@clarakosi clarakosi requested a review from Pchelolo April 17, 2019 16:45
sys/parsoid.js Outdated Show resolved Hide resolved
@Pchelolo Pchelolo changed the title [WIP] Update specs to OpenAPI 3.0.1 Update specs to OpenAPI 3.0.1 Apr 29, 2019
@Pchelolo
Copy link
Contributor

  1. Needs a manual rebase
  2. Needs to explicitly require a new version of hyperswitch once it's released with changes required for this
  3. Let's not worry about travis for now, once @hknustwmf submits a PR for fixing travis (which is totally unrelated) we will rebase this.

@clarakosi clarakosi force-pushed the v3.0.1 branch 2 times, most recently from 5194446 to 174760a Compare April 30, 2019 15:58
@clarakosi
Copy link
Member Author

Rebased but I still need to update service-checker to also look for the base URL at servers[0].url

@Pchelolo
Copy link
Contributor

We are not going to deploy this very soon, so no rush

@d00rman
Copy link
Contributor

d00rman commented May 28, 2019

@clarakosi I think we are finally getting ready to deploy this :) Could you (a) rebase on top of current master (a lot of things have changed!); and (b) bump hyperswitch' version to 0.12.2, please?

@d00rman
Copy link
Contributor

d00rman commented May 28, 2019

(b) bump hyperswitch' version to 0.12.2, please?

@clarakosi euh, this moved to v0.12.3 :P

@clarakosi clarakosi force-pushed the v3.0.1 branch 2 times, most recently from 2abad4e to 3cf9836 Compare May 28, 2019 15:21
@clarakosi
Copy link
Member Author

@Pchelolo @d00rman Rebased + updated dependencies.

v1/announcements.yaml Outdated Show resolved Hide resolved
v1/mathoid.yaml Outdated Show resolved Hide resolved
v1/mathoid.yaml Outdated Show resolved Hide resolved
sys/parsoid.js Outdated Show resolved Hide resolved
@clarakosi clarakosi force-pushed the v3.0.1 branch 2 times, most recently from 3e8943c to 8ab854c Compare May 28, 2019 16:51
lib/mwUtil.js Outdated Show resolved Hide resolved
@Pchelolo
Copy link
Contributor

One small comment, otherwise it's great!

@Pchelolo
Copy link
Contributor

Great!

@Pchelolo Pchelolo self-requested a review May 29, 2019 04:44
@d00rman d00rman merged commit 7aadda0 into wikimedia:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants