oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

allOf + format raises "can not merge incompatible formats" error

Open pierrecamilleri opened this issue 2 years ago • 0 comments

Hi, It looks like a bug to me, but maybe I am doing something wrong, if this is the case, sorry in advance.

When I try to apply oapi-codegen on the following minimal spec, I get the error reproduced below.

paths:
  /test_entry:
    get:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                offendingProperty:
                  type: string,
                  allOf: [
                    {
                      format: uuid,
                      }
                  ]
      responses:
        "200":
          description: Successful operation.
error generating code: error creating operation definitions: error generating body definitions: error generating request body definition: error generating Go schema for property 'offendingProperty': error merging schemas: error merging schemas for AllOf: can not merge incompatible formats

If I put the format outside of the allOf, it works. If I remove the format and put the type statement inside the allOf it works as well. Any help appreciated !

pierrecamilleri avatar Oct 05 '22 12:10 pierrecamilleri