-
-
Notifications
You must be signed in to change notification settings - Fork 96
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe your problem
Hi, it looks like OpenAPI schemas that are used for SDK generation are slightly incomplete.
Specificaly: https://github.com/ory/sdk/blob/master/spec/kratos/v25.4.0.json I have not tested other yet.
I'm trying to produce Swift client for Kratos using https://github.com/apple/swift-openapi-generator, but getting an error of spec validation:
openapi.json: error: Inconsistency encountered when parsing sessionToken in Document.paths['/self-service/settings'].post.security: Each key found in a Security Requirement dictionary must refer to a Security Scheme present in the Components dictionary.
Error: C:/Users/.../openapi.json: error: Inconsistency encountered when parsing sessionToken in Document.paths['/self-service/settings'].post.security: Each key found in a Security Requirement dictionary must refer to a Security Scheme present in the Components dictionary.
That looks valid, as in securitySchemes only oryAccessToken is described. If I add sessionToken scheme, client generation proceeds.
Second issue is 'duplicated' nullTime, specifically schema contains 'nullTime' and 'NullTime' in idiomatic mode, it results in name collision in Apple OAPI generator. So it must be turned off for now. apple/swift-openapi-generator#854 (comment)
While apple's openapi generator does not produce very pleasant API and is usually used as a plugin inside codebase, it supports being used as standalone generator. And fixing this issue will be a great first step for the swift support.
Describe your ideal solution
Fix the schema definition.
Workarounds or alternatives
Copy schema from your repo and edit it.
Using third party swift client generator.
Version
v25.4.0
Additional Context
No response