[Swift] Apple's openapi generator incompatability.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with spec/kratos/v25.4.0.json and inspect the security declaration for POST /self-service/settings, especially sessionToken and components.securitySchemes. Then review the nullTime and NullTime schemas and validate the corrected schema with Apple's swift-openapi-generator; done means both reported incompatibilities are resolved without manual schema edits.
Written by the indexing model from the issue text.
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. https://github.com/apple/swift-openapi-generator/issues/854#issuecomment-3678025561
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
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ory/sdk
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
@ory/kratos typescript API 25.4.0 adds strange "UnknownDefaultOpenApi" von Enums breaking typing Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100