Skip to content

Unable to parse a contract with a raw object #461

@glandais-nickel

Description

@glandais-nickel

In a DTO modeling an error, we have parameters in it, used to format error message to user for instance.

As this parameter can be a number, a string or whatever, we have something like this in our contract :

components:
  schemas:
    Problem:
      type: object
      properties:
        title:
          type: string
        params:
          type: object
          additionalProperties:
            type: object

But the generator is unable to narrow a Type for params values. A workaround has been to add a format: json on additionalProperties in our contract but it is not a viable solution on the long term. It eventually allows to generate correctly our other clients, but this is not what we want to see here.

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