-
Notifications
You must be signed in to change notification settings - Fork 129
Update to OpenAPIKit 3.0.0-alpha.9 #147
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 to OpenAPIKit 3.0.0-alpha.9 #147
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Interesting test failures:
This one is easy—just an error message changed in OpenAPIKit.
This one is more interesting... This is converting from this OpenAPI: extraInfo:
description: Extra information about the error.
allOf:
- $ref: '#/components/schemas/ExtraInfo' But an
This will need looking into further. |
Signed-off-by: Si Beaumont <beaumont@apple.com>
OK, so I've created some tests which isolate the issue. They pass without the OpenAPIKit upgrade, and fail with it. Doesn't necessarily mean it's a bug in OpenAPIKit—we could be making some incorrect assumptions. I've rebased this branch with those commits, one at a time (tests first, then upgrade), to show the issue. The above commit adds tests for the following: ---
# 1
schemas:
A:
type: string
MyAllOf:
allOf:
- $ref: '#/components/schemas/A'
---
# 2
schemas:
A:
type: string
B:
type: object
required:
- c
properties:
c:
allOf:
- $ref: "#/components/schemas/A"
---
# 3
schemas:
A:
type: string
B:
type: object
required: []
properties:
c:
allOf:
- $ref: "#/components/schemas/A" The difference between (2) and (3) should be in just the optionality of the The test is passing fine... Now I'll push the update to upgrade OpenAPIKit. |
f057552
to
7245a77
Compare
Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/translateAllAnyOneOf.swift
Show resolved
Hide resolved
Signed-off-by: Si Beaumont <beaumont@apple.com>
Signed-off-by: Si Beaumont <beaumont@apple.com>
44f3984
to
cf50bd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation
Investigation into #128 led to a new release of OpenAPIKit, which supports path references. Supporting path references isn't something we want to do right now because:
The OpenAPIKit update comes with a new API, because the paths are now an
Either
to support being aPathItem
or a reference to aPathItem
.For now we'd like to be keeping up to date with OpenAPIKit so that, when we support OpenAPI 3.1 and/or external references, we have the APIs we need in the upstream package.
Modifications
Result
An error will be thrown when using an OpenAPI document with a path reference.
Test Plan
Added reference tests.