Skip to content

Create object type if there are links #443

@Alan-Cha

Description

@Alan-Cha

Currently, the response body schema has a higher priority than if there are link objects.

For example, if the response schema is:

"content": {
    "text/plain": {
      "schema": {
        "type": "string"
        }
      }
    }
  }

or

"content": {
    "application/json": {
      "schema": {
        "type": "string"
        }
      }
    }
  }

... OtG will create a field with a string return type, which means we cannot add fields created from link objects.

Only when OtG is already going to create a field with an object return type can a link field be added.

"content": {
    "application/json": {
      "schema": {
        "type": "string",
        "properties": {
          "hello": {
            "type": "string"
          }
        }
      }
    }
  }

I think that if there is a link object, we should consider defaulting to an object type so that we can add the link field. I think it will be a bit more complicated than that because we will need to map the response object appropriately but that is the gist.

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