Skip to content
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 URIValueFromNodeDecoder for DeepObject. #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 29, 2024

  1. Update URIValueFromNodeDecoder for DeepObject.

    ### Motivation
    
    As discussed in [[Generator] Add support of deepObject style in query params #538](apple/swift-openapi-generator#538 (comment)), there is a misimplementation of the `decodeRootIfPresent` method in `URIValueFromNodeDecoder`. When using the `deepObject` style, the node for `rootValue` is correctly empty, containing only the sub-objects.
    
    Without this PR, the tests for [Add support of deepObject style in query params #538](apple/swift-openapi-generator#538) are failing.
    
    ### Modifications
    
    - Updated the `decodeRootIfPresent(_ type:) throws -> T` method to ignore whether `currentElementAsArray` is empty or not.
    
    ### Result
    
    - Enables the tests in the [Generator part of the PR](apple/swift-openapi-generator#538) to pass successfully.
    
    ### Test Plan
    
    This PR includes unit tests that validate the change to `decodeRootIfPresent(_ type:) throws -> T` within `Test_Converter+Server` as well as in `Test_serverConversionExtensions`.
    kstefanou52 committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    b35daeb View commit details
    Browse the repository at this point in the history