apple / swift-openapi-generator

Generate Swift client and server code from an OpenAPI document.
https://swiftpackageindex.com/apple/swift-openapi-generator/documentation
Apache License 2.0
1.21k stars 87 forks source link

[Generator] Add support of deepObject style in query params #538

Open kstefanou52 opened 2 months ago

kstefanou52 commented 2 months ago

Motivation

The generator changes for: apple/swift-openapi-generator

Depends on https://github.com/apple/swift-openapi-runtime/pull/100 landing first and getting released, and the version dependency being bumped here.

Modifications

Added deepObject style to serializer & parser in order to support nested keys on query parameters.

Result

Support nested keys on query parameters.

Test Plan

Adapted snippet tests (SnippetBasedReferenceTests)

simonjbeaumont commented 2 months ago

Thanks @kstefanou52 for taking the time to tackle this. We'll park this PR review until we land the runtime PR.

czechboy0 commented 1 month ago

@kstefanou52 Ok please bump the runtime dependency to 1.4.0 in Package.swift and you should be able to finish the generator changes.

kstefanou52 commented 1 month ago

@czechboy0 Done! I have created some tests, but I'm not sure if you would like to add more. Could you please suggest any additional tests you think might be necessary? Thank you!