Skip to content

Unable to open the rolodex file if using external ref and git history #208

@Fab1n

Description

@Fab1n

This tool, and libopenapi respectively, cannot (to my knowledge) handle a very common case, which is:

  • define an OpenAPI schema with external references (pointing to local files relative to the schema file)
  • push that schema
  • remove any of the $ref'ed schemas from the repo and push the new changes
  • do any changes afterwards that do not bring back this $ref file from the past

Whenever openapi-changes checks the git history and compares file changes there will always be this error:

https://github.com/pb33f/libopenapi/blob/1f17c502e78acf5984a49a3459fcc37ce316c0c8/index/find_component.go#L161
Image

I tried --ext-refs and -p with different path combinations, no success.

I'd contribute to the project, but Go is not my lang of expertise and I also read @daveshanley is rewriting it.

Here is a sample project that perfectly demonstrates the issue in its simplest form:
openapi-changes-ref-bug.zip

  • unzip the folder
  • cd into it
  • execute openapi-changes html-report . openapi.yaml
  • also try `openapi-changes html-report --ext-refs -p . . openapi.yaml

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