Skip to content

OpenApi query string serialization is not configurable #8760

@chargePanelAndreas

Description

@chargePanelAndreas

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

There is no way to pass a deepObject with a GET-parameter format that PHP recognizes.

loadOpenAPISubgraph takes a queryStringOptions object but that is ignored in loaders/json-schema addExecutionDirectivesToComposer by falling back to undefined when no operation-specific option has been provided:

            queryStringOptions:
              'queryStringOptions' in operationConfig
                ? operationConfig.queryStringOptions
                : undefined,

Instead we should fallback to the queryStringOptions that is passed in:

            queryStringOptions:
              'queryStringOptions' in operationConfig
                ? operationConfig.queryStringOptions
                : queryStringOptions,

To Reproduce Steps to reproduce the behavior:

This config does not change the behaviour:

export const composeConfig = defineComposeConfig({
  output: 'supergraph.ts',
  subgraphs: [
    {
      sourceHandler: loadOpenAPISubgraph('User', {
...
        queryStringOptions : { arrayFormat: 'brackets' }
      })
    },

Expected behavior

Config should be respected

Environment:

Additional context

Fix:
packages/loaders/json-schema/src/addExecutionLogicToComposer.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions