Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Handling default in proto2 #184

Open
alexloginov opened this issue Apr 17, 2024 · 0 comments
Open

Handling default in proto2 #184

alexloginov opened this issue Apr 17, 2024 · 0 comments

Comments

@alexloginov
Copy link

Hi!

Is there a way to include to Json Schema default values of the fields? Proto2 supports defaults.

Example:

message MyMsg {
    optional string a = 1 ;
    optional string b = 2 [default = "NOT_SPECIFIED"];
}

I would expect to see something like:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "$ref": "#/definitions/Lifecycle",
    "definitions": {
        "MyMsg": {
            "properties": {
                "a": {
                    "type": "string"
                },
                "minor": {
                    "b": "string",
                    "default": "NOT_SPECIFIED"
                }
            },
            "additionalProperties": true,
            "type": "object",
            "title": "MyMsg"
        }
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant