Skip to content

Question: How to deal with dictionaries #2210

@FaFre

Description

@FaFre

To get a bit familiar with the OpenAPI Spec's, I decided to document an already existing API (out of my control) which I wanted to consume anyways. I know that's the wrong way around, but a good way to learn.

However, I came across a tricky thing:
As a response I get an array of objects. But the "feature" is, the objects are defined as key-value-pair's, where the key is the index of the response:

{
    "count": "2",
    "results": {
        "0": {
            "text": "hello"
        },
         "1": {
            "text": "hello"
        }
}

Is there a way to solve this dynamically, like to interpret it as a dictionary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions