Closed ChipCracker closed 4 months ago
Hi @ChipCracker, thank you for this great bug report!
You are correct, the bug is caused by the hyphen in the parameter name. It isn't getting correctly parsed by the regular expression that splits the path into components.
I have a fix ready locally, let me open a PR shortly.
Hi @czechboy0
thank you for the swift response and for preparing a fix so quickly!
You're welcome, it was only possible because you already did the heavy lifting and identified the bug 🙂
Fixed and released in 1.3.0: https://github.com/apple/swift-openapi-generator/releases/tag/1.3.0
Description
When generating Swift code from the API spec, path variables that contain a “-” are not recognized as path variables and are instead generated as fixed URL parameters/paths. However the path variable is generated correctly, its just not used:
Example:
/testresult/upload/{qrcode-uuid}:
Becomes (Client.swift):
However, the expected behavior would be:
Types.swift:
Reproduction
Package version(s)
Expected behavior
Environment
Additional information
Currently generated code: