Skip to content

Conversation

@stevehu
Copy link
Contributor

@stevehu stevehu commented Dec 17, 2025

No description provided.

@stevehu
Copy link
Contributor Author

stevehu commented Dec 17, 2025

@sschuberth, This PR targets the master branch and will be backported to the 2.x branch once it has been reviewed and approved. Please let us know if you encounter any issues. Thank you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Collaborator

@justin-tay justin-tay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think this is a good idea particularly as some of what it is doing like determining the version based on the file path seems rather odd to be exposing to users.

I'm not sure if the users really know what they are doing as the dialect is already automatically detected from $schema. A lot of people use their own ObjectMapper to parse it to JsonNode, and this is rather unnecessary, particularly if you want to have line numbers as the library needs to use it's own to do so.

I don't mind if something like public static Optional<SpecificationVersion> fromSchemaNode(JsonNode) was added to SpecificationVersion but would like to know exactly what their use case is and if there is a better way to solve their use case.

@stevehu
Copy link
Contributor Author

stevehu commented Dec 17, 2025

@justin-tay, I completely agree with you. I do not think this is the right approach; however, it was our mistake to introduce this class earlier, and some users are already relying on it. Removing it abruptly would break their code.

One option is to restore it in the 2.x branch and mark it as deprecated, while removing it from the master branch. What are your thoughts on this approach?

@justin-tay
Copy link
Collaborator

While the approach sounds reasonable, the upgrade to 2.x was already a rather large breaking change. Without resolving the actual underlying issue, this will just come up again for 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants