OpenAPITools / openapi-diff

Utility for comparing two OpenAPI specifications.
Apache License 2.0
832 stars 154 forks source link

false positive for type if only the format is changed. #248

Open stefanvitz opened 3 years ago

stefanvitz commented 3 years ago

i changed the format of a string property. e.g. when generated out of java and the propery is now mapped via Spring from a String to a UUID.

Perhaps it's correct to report a change. but the change is not on the type but on the format. and therefore userUid (string -> string) does not help.

old

"ServicePageInteractionRequest":{
   "type":"object",
   "properties":{
      "userUid":{
         "type":"string"
      },
      ...
   }
}

new

"ServicePageInteractionRequest" : {
   "type" : "object",
   "properties" : {
      "userUid" : {
         "type" : "string",
         "format" : "uuid",
         "example" : "5412185d-2cf1-46d0-85d3-50bfc93b1122"
       },
      ...
   }
}

report:

Changed property type: userUid (string -> string)
stefanvitz commented 3 years ago

might be related to https://github.com/OpenAPITools/openapi-diff/issues/192 but the changes were different there so i decided to open a seperate issue.

M0dM commented 2 years ago

I am not very used to work in java, but adding a breakpoint on this line might help to understand the issue: https://github.com/OpenAPITools/openapi-diff/blob/d9fff612a2a6200fd167f5d123aecccccc73912a/core/src/main/java/org/openapitools/openapidiff/core/compare/SchemaDiff.java#L326