Git Product home page Git Product logo

Comments (5)

daveshanley avatar daveshanley commented on June 15, 2024

I will investigate, thanks for finding this.

from libopenapi.

hugoboos avatar hugoboos commented on June 15, 2024

Found a possible cause on https://github.com/pb33f/libopenapi/blob/main/what-changed/model/example.go#L73.

The Tag of the Value is not taken in to account. !!timestamp vs !!str.

I will create a PR.

from libopenapi.

hugoboos avatar hugoboos commented on June 15, 2024

This is not fixed with my fix in #62.

The test case didn't include a map as a value:

value:
  map:
    date: 2022-12-29`

The changes := CompareExamples(&lDoc, &rDoc) returns nil. In places where it is used, there is no nil check: https://github.com/pb33f/libopenapi/blob/main/what-changed/model/media_type.go#L26

It is assigned by CheckMapForChangesWithComp on https://github.com/pb33f/libopenapi/blob/main/what-changed/model/comparison_functions.go#L253.

So there are a few places where it can break and this might not only be related to examples.

from libopenapi.

daveshanley avatar daveshanley commented on June 15, 2024

I will check for other instances of this issue.

from libopenapi.

daveshanley avatar daveshanley commented on June 15, 2024

This is an isolated incident; after reviewing the other models, examples are the only place where this type of comparison is performed. The glitch was a nil reference being added to the resulting map, as you detected, the code now performs a check before adding the results, and examples that use complex shapes are now hashed for comparison. The fix is in #65

from libopenapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.