Skip to content

bug: hashes inside an array with different types are not picked up properly #270

@Spence1115

Description

@Spence1115

Summary

When a nested entry inside a response contained multiple possible types, we were only ever returning the first one. For example:

        {
          "fields" => [
            {
              "id" => "country_code",
              "options" => [
                {
                  "id" => "us",
                  "label" => "United States"
                },
                {
                  "id" => "ca",
                  "label" => "Canada"
                }
              ]
            },
            {
              "id" => "region_id",
              "options" => [
                {
                  "id" => 1,
                  "label" => "New York"
                },
                {
                  "id" => 2,
                  "label" => "California"
                }
              ]
            }
          ]
        }

For this, the id in options was being marked as type: string, when it should have been oneOf: string | number

I have already raised a PR to fix this

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