Skip to content

Two path items have the same signature - must include Http-Method into check  #170

Closed
@ahoehma

Description

@ahoehma

Hi,

I think I found a little bug in the diff algorithm ... please correct my if I'm wrong 😃

My schema contains something like this:
GET /api/vi/configuration/{configurationId}
POST /api/vi/configuration/{productId}

If run the diff then I got an error because of found more then one "/api/vi/configuration/{}".

I tried to fix this by adding an additional check:

Optional<String> result =
        right.keySet().stream()
             .filter(s -> normalizePath(s).equals(template))
             .findFirst();

to

Optional<String> result =
        right.keySet().stream()
            .filter(s -> normalizePath(s).equals(template) && right.get(s).readOperations().equals(leftPath.readOperations()))
            .findFirst();

to com.qdesrame.openapi.diff.core.compare.PathsDiff.diff(Map<String, PathItem>, Map<String, PathItem>)

The exception is gone ... but now I have strange compare results if the api is 100% equal. So I guess my fix is not 100% complete yet.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions