pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.66k stars 463 forks source link

JSON output loses field identification information #519

Open mkurittu opened 1 year ago

mkurittu commented 1 year ago
message Test {
    int32 first = 1; //!First
        int32 third = 3; //!Third
    int32 secord = 2;  //!Second
}

outputs

      "messages": [
        {
          "name": "Test",
          "longName": "Test",
          "fullName": ".Test",
          "description": "",
          "hasExtensions": false,
          "hasFields": true,
          "hasOneofs": false,
          "extensions": [],
          "fields": [
            {
              "name": "first",
              "description": "!First",
              "label": "",
              "type": "int32",
              "longType": "int32",
              "fullType": "int32",
              "ismap": false,
              "isoneof": false,
              "oneofdecl": "",
              "defaultValue": ""
            },
            {
              "name": "third",
              "description": "!Third",
              "label": "",
              "type": "int32",
              "longType": "int32",
              "fullType": "int32",
              "ismap": false,
              "isoneof": false,
              "oneofdecl": "",
              "defaultValue": ""
            },
            {
              "name": "secord",
              "description": "!Second",
              "label": "",
              "type": "int32",
              "longType": "int32",
              "fullType": "int32",
              "ismap": false,
              "isoneof": false,
              "oneofdecl": "",
              "defaultValue": ""
            }
          ]
        }

Enums have kind of similar representation already. Would it be possible to have such in messages too?

"enums": [
        {
          "name": "eTest",
          "longName": "eTest",
          "fullName": ".eTest",
          "description": "",
          "values": [
            {
              "name": "val0",
              "number": "0",
              "description": ""
            },
            {
              "name": "val2",
              "number": "2",
              "description": ""
            },
            {
              "name": "val1",
              "number": "1",
              "description": ""
            }
          ]
        }
      ],