Skip to content

Support protobuf Any type #230

@stan-is-hate

Description

@stan-is-hate

This is related to supporting raw bytes - #229
Any type is similar - it's just bytes plus a url describing the type.
https://github.com/protobuf-net/protobuf-net/blob/main/src/protobuf-net.Reflection/google/protobuf/any.proto
An ideal implementation would make this transparent to the user, for example, in your json your response might be:

"response": {
			"name": "notEmpty('Big Tree')",
			"location": {
				"latitude": "matching(number, 180)",
				"longitude": "matching(number, 200)"
			}
		}

but in your proto the type of response is defined as Any. The framework can then take those input bytes, find the corresponding proto with which to decode them, and use that decoded proto for matching.
The client shouldn't need to specify that the field is Any in the response really, unless I'm missing something

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