Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apple/swift-openapi-runtime
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.3.2
Choose a base ref
...
head repository: apple/swift-openapi-runtime
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.4.0
Choose a head ref
  • 5 commits
  • 23 files changed
  • 5 contributors

Commits on Mar 11, 2024

  1. Configuration menu
    Copy the full SHA
    a875c2d View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. Fix empty additionalProperties dictionary encoding (#103)

    ### Motivation
    
    Fixes apple/swift-openapi-generator#525.
    
    Turns out that the mere act of creating a decoding container is
    meaningful and we skipped it as an optimization, causing JSONDecoder to
    fail for empty dictionaries when used in additional properties.
    
    ### Modifications
    
    Remove the extra guards that skipped creating a container, even when we
    already know there are no elements.
    
    ### Result
    
    No more failures when encoding empty dictionaries in
    additionalProperties.
    
    ### Test Plan
    
    Tested manually as this requirement seems to be coming out of
    JSONDecoder.
    czechboy0 authored Apr 3, 2024
    Configuration menu
    Copy the full SHA
    634b7eb View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Add support for application/xml body (#102)

    ### Motivation
    
    See
    [apple/swift-openapi-generator#556](apple/swift-openapi-generator#556)
    for more.
    
    ### Modifications
    
    Add converter methods for encoding and decoding XML request and response
    body.
    Add `CustomCoder` protocol, allows to use other `Encoder` and `Decoder`
    for other `content-type` body.
    
    User can define custom coder, and assign a custom coder to a specific
    content-type within `Configuration.customCoders` dictionary.
    
    ### Result
    
    It's now possible to define custom encoder and decoder for supported
    content-type.
    
    ### Test Plan
    
    Added converter methods are tested with a mock custom coder for
    `application/xml` content-type. To avoid adding a dependency to a
    XMLCoder like
    [CoreOffice/XMLCoder](https://github.com/CoreOffice/XMLCoder), mock
    custom coder uses JSONEncoder and JSONDecoder.
    
    Encoding and decoding to XML are out of scope of the tests, because
    encoding and decoding logic must be provided by user through custom
    coder implementation.
    
    ---------
    
    Signed-off-by: Ugo Cottin <[email protected]>
    Co-authored-by: Honza Dvorsky <[email protected]>
    ugocottin and czechboy0 authored Apr 5, 2024
    Configuration menu
    Copy the full SHA
    6e2f9b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Improve error message when encountering unexpected content-type heade…

    …rs (#104)
    
    ### Motivation
    
    When the server response has a content-type header that does not conform
    to the OpenAPI document, we currently throw an error. However, this
    error presents itself in a very confusing manner: it prints `Unexpected
    Content-Type header: application/json`, where `application/json is the
    _expected_ content-type. At best, this is ambiguous and potentially
    misleading.
    
    ### Modifications
    
    - Extend `case RuntimeError.unexpectedContentTypeHeader` with _both_ the
    expected and received content-type associated values.
    - Update the printed description to include both the expected and
    received content-type header values.
    
    ### Result
    
    When an unexpected content-type is received, the error message is
    clearer.
    
    ### Test Plan
    
    Updated the existing test that expects an error to check the error and
    that the error values are provided in the correct order.
    simonjbeaumont authored Apr 9, 2024
    Configuration menu
    Copy the full SHA
    9d4a2ff View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. [Runtime] Add support of deepObject style in query params (#100)

    ### Motivation
    
    The runtime changes for:
    apple/swift-openapi-generator#259
    
    ### 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
    
    These are just the runtime changes, tested together with generated
    changes.
    
    ---------
    
    Co-authored-by: Honza Dvorsky <[email protected]>
    kstefanou52 and czechboy0 authored Apr 16, 2024
    Configuration menu
    Copy the full SHA
    9a8291f View commit details
    Browse the repository at this point in the history
Loading