Skip to content

Make a type for an MCP requestId #32733

@Azquelt

Description

@Azquelt

MCP requests can either be a number or a string. At the moment we store it as an object of whatever JSON-B returns to us. This has a few problems:

  • it makes it hard to compare ids for equality
    • 2 is a different id to "2"
    • however, we're not sure what type we use to represent the id internally, so we don't know how it implements equals
    • in particular, new BigInteger(2) is not equal to Long.valueOf(2) which is not equal to Integer.valueOf(2)

Create a class that can hold either of these, but nothing else and which implements equals and hashCode reliably and use it to store the ID of a request.

Metadata

Metadata

Assignees

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