diff --git a/packages/protobuf-test/extra/json_types.proto b/packages/protobuf-test/extra/json_types.proto index 0be1cfc9e..0aa948069 100644 --- a/packages/protobuf-test/extra/json_types.proto +++ b/packages/protobuf-test/extra/json_types.proto @@ -24,7 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; message JsonTypesMessage { - bool bool_field = 1; + bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; double double_field = 2; bytes bytes_field = 3; int64 int64_field = 4; diff --git a/packages/protobuf-test/src/extension-accessor.test.ts b/packages/protobuf-test/src/extensions.test.ts similarity index 100% rename from packages/protobuf-test/src/extension-accessor.test.ts rename to packages/protobuf-test/src/extensions.test.ts diff --git a/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.d.ts b/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.d.ts index 390ae2c50..681e98e8a 100644 --- a/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.d.ts +++ b/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.d.ts @@ -30,7 +30,7 @@ export declare const file_extra_json_types: GenDescFile; */ export declare type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ boolField: boolean; @@ -165,9 +165,9 @@ export declare type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { */ export declare type JsonTypesMessageJson = { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ - boolField?: boolean; + booleanFieldWithCustomName?: boolean; /** * @generated from field: double double_field = 2; diff --git a/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.js b/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.js index d1dc6dd26..1f2f78fa4 100644 --- a/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.js +++ b/packages/protobuf-test/src/gen/js,json_types/extra/json_types_pb.js @@ -23,7 +23,7 @@ import { file_google_protobuf_any, file_google_protobuf_duration, file_google_pr * Describes the file extra/json_types.proto. */ export const file_extra_json_types = /*@__PURE__*/ - fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjItIKChBKc29uVHlwZXNNZXNzYWdlEhIKCmJvb2xfZmllbGQYASABKAgSFAoMZG91YmxlX2ZpZWxkGAIgASgBEhMKC2J5dGVzX2ZpZWxkGAMgASgMEhMKC2ludDY0X2ZpZWxkGAQgASgDEiYKCmVudW1fZmllbGQYBSABKA4yEi5zcGVjLkpzb25UeXBlRW51bRItCg1tZXNzYWdlX2ZpZWxkGAYgASgLMhYuc3BlYy5Kc29uVHlwZXNNZXNzYWdlEicKCWFueV9maWVsZBgHIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkSMQoOZHVyYXRpb25fZmllbGQYCCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SKwoLZW1wdHlfZmllbGQYCSABKAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHkSNAoQZmllbGRfbWFza19maWVsZBgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sSLQoMc3RydWN0X2ZpZWxkGAsgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIrCgt2YWx1ZV9maWVsZBgMIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRI0ChBsaXN0X3ZhbHVlX2ZpZWxkGA0gASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZRI0ChBudWxsX3ZhbHVlX2ZpZWxkGA4gASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZRIzCg90aW1lc3RhbXBfZmllbGQYDyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjoKFHdyYXBwZWRfZG91YmxlX2ZpZWxkGBAgASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVlEjgKE3dyYXBwZWRfZmxvYXRfZmllbGQYESABKAsyGy5nb29nbGUucHJvdG9idWYuRmxvYXRWYWx1ZRI4ChN3cmFwcGVkX2ludDY0X2ZpZWxkGBIgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSOgoUd3JhcHBlZF91aW50NjRfZmllbGQYEyABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDY0VmFsdWUSOAoTd3JhcHBlZF9pbnQzMl9maWVsZBgUIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlEjoKFHdyYXBwZWRfdWludDMyX2ZpZWxkGBUgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEjYKEndyYXBwZWRfYm9vbF9maWVsZBgWIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSOgoUd3JhcHBlZF9zdHJpbmdfZmllbGQYFyABKAsyHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUSOAoTd3JhcHBlZF9ieXRlc19maWVsZBgYIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5CeXRlc1ZhbHVlEi8KE3JlcGVhdGVkX2VudW1fZmllbGQYGSADKA4yEi5zcGVjLkpzb25UeXBlRW51bRJJChNtYXBfYm9vbF9lbnVtX2ZpZWxkGBogAygLMiwuc3BlYy5Kc29uVHlwZXNNZXNzYWdlLk1hcEJvb2xFbnVtRmllbGRFbnRyeRpLChVNYXBCb29sRW51bUZpZWxkRW50cnkSCwoDa2V5GAEgASgIEiEKBXZhbHVlGAIgASgOMhIuc3BlYy5Kc29uVHlwZUVudW06AjgBKl0KDEpzb25UeXBlRW51bRIeChpKU09OX1RZUEVfRU5VTV9VTlNQRUNJRklFRBAAEhYKEkpTT05fVFlQRV9FTlVNX1lFUxABEhUKEUpTT05fVFlQRV9FTlVNX05PEAJiBnByb3RvMw", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct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ZWxkGBEgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkZsb2F0VmFsdWUSOAoTd3JhcHBlZF9pbnQ2NF9maWVsZBgSIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEjoKFHdyYXBwZWRfdWludDY0X2ZpZWxkGBMgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQ2NFZhbHVlEjgKE3dyYXBwZWRfaW50MzJfZmllbGQYFCABKAsyGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRI6ChR3cmFwcGVkX3VpbnQzMl9maWVsZBgVIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1ZRI2ChJ3cmFwcGVkX2Jvb2xfZmllbGQYFiABKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlEjoKFHdyYXBwZWRfc3RyaW5nX2ZpZWxkGBcgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEjgKE3dyYXBwZWRfYnl0ZXNfZmllbGQYGCABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZRIvChNyZXBlYXRlZF9lbnVtX2ZpZWxkGBkgAygOMhIuc3BlYy5Kc29uVHlwZUVudW0SSQoTbWFwX2Jvb2xfZW51bV9maWVsZBgaIAMoCzIsLnNwZWMuSnNvblR5cGVzTWVzc2FnZS5NYXBCb29sRW51bUZpZWxkRW50cnkaSwoVTWFwQm9vbEVudW1GaWVsZEVudHJ5EgsKA2tleRgBIAEoCBIhCgV2YWx1ZRgCIAEoDjISLnNwZWMuSnNvblR5cGVFbnVtOgI4ASpdCgxKc29uVHlwZUVudW0SHgoaSlNPTl9UWVBFX0VOVU1fVU5TUEVDSUZJRUQQABIWChJKU09OX1RZUEVfRU5VTV9ZRVMQARIVChFKU09OX1RZUEVfRU5VTV9OTxACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); /** * Describes the message spec.JsonTypesMessage. diff --git a/packages/protobuf-test/src/gen/js/extra/json_types_pb.d.ts b/packages/protobuf-test/src/gen/js/extra/json_types_pb.d.ts index 543700491..76da1c2e4 100644 --- a/packages/protobuf-test/src/gen/js/extra/json_types_pb.d.ts +++ b/packages/protobuf-test/src/gen/js/extra/json_types_pb.d.ts @@ -30,7 +30,7 @@ export declare const file_extra_json_types: GenDescFile; */ export declare type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ boolField: boolean; diff --git a/packages/protobuf-test/src/gen/js/extra/json_types_pb.js b/packages/protobuf-test/src/gen/js/extra/json_types_pb.js index 7d90ac74f..27c28df69 100644 --- a/packages/protobuf-test/src/gen/js/extra/json_types_pb.js +++ b/packages/protobuf-test/src/gen/js/extra/json_types_pb.js @@ -23,7 +23,7 @@ import { file_google_protobuf_any, file_google_protobuf_duration, file_google_pr * Describes the file extra/json_types.proto. */ export const file_extra_json_types = /*@__PURE__*/ - fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjItIKChBKc29uVHlwZXNNZXNzYWdlEhIKCmJvb2xfZmllbGQYASABKAgSFAoMZG91YmxlX2ZpZWxkGAIgASgBEhMKC2J5dGVzX2ZpZWxkGAMgASgMEhMKC2ludDY0X2ZpZWxkGAQgASgDEiYKCmVudW1fZmllbGQYBSABKA4yEi5zcGVjLkpzb25UeXBlRW51bRItCg1tZXNzYWdlX2ZpZWxkGAYgASgLMhYuc3BlYy5Kc29uVHlwZXNNZXNzYWdlEicKCWFueV9maWVsZBgHIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkSMQoOZHVyYXRpb25fZmllbGQYCCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SKwoLZW1wdHlfZmllbGQYCSABKAsyFi5n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oTd3JhcHBlZF9ieXRlc19maWVsZBgYIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5CeXRlc1ZhbHVlEi8KE3JlcGVhdGVkX2VudW1fZmllbGQYGSADKA4yEi5zcGVjLkpzb25UeXBlRW51bRJJChNtYXBfYm9vbF9lbnVtX2ZpZWxkGBogAygLMiwuc3BlYy5Kc29uVHlwZXNNZXNzYWdlLk1hcEJvb2xFbnVtRmllbGRFbnRyeRpLChVNYXBCb29sRW51bUZpZWxkRW50cnkSCwoDa2V5GAEgASgIEiEKBXZhbHVlGAIgASgOMhIuc3BlYy5Kc29uVHlwZUVudW06AjgBKl0KDEpzb25UeXBlRW51bRIeChpKU09OX1RZUEVfRU5VTV9VTlNQRUNJRklFRBAAEhYKEkpTT05fVFlQRV9FTlVNX1lFUxABEhUKEUpTT05fVFlQRV9FTlVNX05PEAJiBnByb3RvMw", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); + fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjIu4KChBKc29uVHlwZXNNZXNzYWdlEi4KCmJvb2xfZmllbGQYASABKAhSGmJvb2xlYW5GaWVsZFdpdGhDdXN0b21OYW1lEhQKDGRvdWJsZV9maWVsZBgCIAEoARITCgtieXRlc19maWVsZBgDIAEoDBITCgtpbnQ2NF9maWVsZBgEIAEoAxImCgplbnVtX2ZpZWxkGAUgASgOMhIuc3BlYy5Kc29uVHlwZUVudW0SLQoNbWVzc2FnZV9maWVsZBgGIAEoCzIWLnNwZWMuSnNvblR5cGVzTWVzc2FnZRInCglhbnlfZmllbGQYByABKAsyFC5nb29nbGUucHJvdG9idWYuQW55EjEKDmR1cmF0aW9uX2ZpZWxkGAggASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEisKC2VtcHR5X2ZpZWxkGAkgASgLMhYuZ29vZ2xlLnByb3Rv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lEjgKE3dyYXBwZWRfYnl0ZXNfZmllbGQYGCABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZRIvChNyZXBlYXRlZF9lbnVtX2ZpZWxkGBkgAygOMhIuc3BlYy5Kc29uVHlwZUVudW0SSQoTbWFwX2Jvb2xfZW51bV9maWVsZBgaIAMoCzIsLnNwZWMuSnNvblR5cGVzTWVzc2FnZS5NYXBCb29sRW51bUZpZWxkRW50cnkaSwoVTWFwQm9vbEVudW1GaWVsZEVudHJ5EgsKA2tleRgBIAEoCBIhCgV2YWx1ZRgCIAEoDjISLnNwZWMuSnNvblR5cGVFbnVtOgI4ASpdCgxKc29uVHlwZUVudW0SHgoaSlNPTl9UWVBFX0VOVU1fVU5TUEVDSUZJRUQQABIWChJKU09OX1RZUEVfRU5VTV9ZRVMQARIVChFKU09OX1RZUEVfRU5VTV9OTxACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); /** * Describes the message spec.JsonTypesMessage. diff --git a/packages/protobuf-test/src/gen/ts,json_types/extra/json_types_pb.ts b/packages/protobuf-test/src/gen/ts,json_types/extra/json_types_pb.ts index 79b6ef8ce..f01afdf8d 100644 --- a/packages/protobuf-test/src/gen/ts,json_types/extra/json_types_pb.ts +++ b/packages/protobuf-test/src/gen/ts,json_types/extra/json_types_pb.ts @@ -26,14 +26,14 @@ import type { JsonObject, Message } from "@bufbuild/protobuf"; * Describes the file extra/json_types.proto. */ export const file_extra_json_types: GenDescFile = /*@__PURE__*/ - fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjItIKChBKc29uVHlwZXNNZXNzYWdlEhIKCmJvb2xfZmllbGQYASABKAgSFAoMZG91YmxlX2ZpZWxkGAIgASgBEhMKC2J5dGVzX2ZpZWxkGAMgASgMEhMKC2ludDY0X2ZpZWxkGAQgASgDEiYKCmV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Zi5JbnQzMlZhbHVlEjoKFHdyYXBwZWRfdWludDMyX2ZpZWxkGBUgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEjYKEndyYXBwZWRfYm9vbF9maWVsZBgWIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSOgoUd3JhcHBlZF9zdHJpbmdfZmllbGQYFyABKAsyHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUSOAoTd3JhcHBlZF9ieXRlc19maWVsZBgYIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5CeXRlc1ZhbHVlEi8KE3JlcGVhdGVkX2VudW1fZmllbGQYGSADKA4yEi5zcGVjLkpzb25UeXBlRW51bRJJChNtYXBfYm9vbF9lbnVtX2ZpZWxkGBogAygLMiwuc3BlYy5Kc29uVHlwZXNNZXNzYWdlLk1hcEJvb2xFbnVtRmllbGRFbnRyeRpLChVNYXBCb29sRW51bUZpZWxkRW50cnkSCwoDa2V5GAEgASgIEiEKBXZhbHVlGAIgASgOMhIuc3BlYy5Kc29uVHlwZUVudW06AjgBKl0KDEpzb25UeXBlRW51bRIeChpKU09OX1RZUEVfRU5VTV9VTlNQRUNJRklFRBAAEhYKEkpTT05fVFlQRV9FTlVNX1lFUxABEhUKEUpTT05fVFlQRV9FTlVNX05PEAJiBnByb3RvMw", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); + fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjIu4KChBKc29uVHlwZXNNZXNzYWdlEi4KCmJvb2xfZmllbGQYASABKAhSGmJvb2xlYW5GaWVsZFdpdGhDdXN0b21OYW1lEhQKDGRvdWJsZV9maWVsZBgCIAEoARITCgtieXRlc19maWVsZBgDIAEoDBITCgtpbnQ2NF9maWVsZBgEIAEoAxImCgplbnVtX2ZpZWxkGAUgASgO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YuSW50MzJWYWx1ZRI6ChR3cmFwcGVkX3VpbnQzMl9maWVsZBgVIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1ZRI2ChJ3cmFwcGVkX2Jvb2xfZmllbGQYFiABKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlEjoKFHdyYXBwZWRfc3RyaW5nX2ZpZWxkGBcgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEjgKE3dyYXBwZWRfYnl0ZXNfZmllbGQYGCABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZRIvChNyZXBlYXRlZF9lbnVtX2ZpZWxkGBkgAygOMhIuc3BlYy5Kc29uVHlwZUVudW0SSQoTbWFwX2Jvb2xfZW51bV9maWVsZBgaIAMoCzIsLnNwZWMuSnNvblR5cGVzTWVzc2FnZS5NYXBCb29sRW51bUZpZWxkRW50cnkaSwoVTWFwQm9vbEVudW1GaWVsZEVudHJ5EgsKA2tleRgBIAEoCBIhCgV2YWx1ZRgCIAEoDjISLnNwZWMuSnNvblR5cGVFbnVtOgI4ASpdCgxKc29uVHlwZUVudW0SHgoaSlNPTl9UWVBFX0VOVU1fVU5TUEVDSUZJRUQQABIWChJKU09OX1RZUEVfRU5VTV9ZRVMQARIVChFKU09OX1RZUEVfRU5VTV9OTxACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); /** * @generated from message spec.JsonTypesMessage */ export type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ boolField: boolean; @@ -168,9 +168,9 @@ export type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { */ export type JsonTypesMessageJson = { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ - boolField?: boolean; + booleanFieldWithCustomName?: boolean; /** * @generated from field: double double_field = 2; diff --git a/packages/protobuf-test/src/gen/ts/extra/json_types_pb.ts b/packages/protobuf-test/src/gen/ts/extra/json_types_pb.ts index 8b0f6519b..65f830b0b 100644 --- a/packages/protobuf-test/src/gen/ts/extra/json_types_pb.ts +++ b/packages/protobuf-test/src/gen/ts/extra/json_types_pb.ts @@ -26,14 +26,14 @@ import type { JsonObject, Message } from "@bufbuild/protobuf"; * Describes the file extra/json_types.proto. */ export const file_extra_json_types: GenDescFile = /*@__PURE__*/ - fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjItIKChBKc29uVHlwZXNNZXNzYWdlEhIKCmJvb2xfZmllbGQYASABKAgSFAoMZG91YmxlX2ZpZWxkGAIgASgBEhMKC2J5dGVzX2ZpZWxkGAMgASgMEhMKC2ludDY0X2ZpZWxkGAQgASgDEiYKCmVudW1fZmllbGQYBSABKA4yEi5zcGVjLkpzb25UeXBlRW51bRItCg1tZXNzYWdlX2ZpZWxkGAYgASgLMhYuc3BlYy5Kc29uVHlwZXNNZXNzYWdlEicKCWFueV9maWVsZBgHIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkSMQoOZHVyYXRpb25fZmllbGQYCCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SKwoLZW1wdHlfZmllbGQYCSABKAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHkSNAoQZmllbGRfbWFza19maWVsZBgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sSLQoMc3RydWN0X2ZpZWxkGAsgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIrCgt2YWx1ZV9maWVsZBgMIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRI0ChBsaXN0X3ZhbHVlX2ZpZWxkGA0gASgLMhouZ29vZ2xlLnByb3RvYnVmLkx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EiEKBXZhbHVlGAIgASgOMhIuc3BlYy5Kc29uVHlwZUVudW06AjgBKl0KDEpzb25UeXBlRW51bRIeChpKU09OX1RZUEVfRU5VTV9VTlNQRUNJRklFRBAAEhYKEkpTT05fVFlQRV9FTlVNX1lFUxABEhUKEUpTT05fVFlQRV9FTlVNX05PEAJiBnByb3RvMw", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); + fileDesc("ChZleHRyYS9qc29uX3R5cGVzLnByb3RvEgRzcGVjIu4KChBKc29uVHlwZXNNZXNzYWdlEi4KCmJvb2xfZmllbGQYASABKAhSGmJvb2xlYW5GaWVsZFdpdGhDdXN0b21OYW1lEhQKDGRvdWJsZV9maWVsZBgCIAEoARITCgtieXRlc19maWVsZBgDIAEoDBITCgtpbnQ2NF9maWVsZBgEIAEoAxImCgplbnVtX2ZpZWxkGAUgASgOMhIuc3BlYy5Kc29uVHlwZUVudW0SLQoNbWVzc2FnZV9maWVsZBgGIAEoCzIWLnNwZWMuSnNvblR5cGVzTWVzc2FnZRInCglhbnlfZmllbGQYByABKAsyFC5nb29nbGUucHJvdG9idWYuQW55EjEKDmR1cmF0aW9uX2ZpZWxkGAggASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEisKC2VtcHR5X2ZpZWxkGAkgASgLMhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5EjQKEGZpZWxkX21hc2tfZmllbGQYCiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrEi0KDHN0cnVjdF9maWVsZBgLIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSKwoLdmFsdWVfZmllbGQYDCABKAsyFi5nb29nbGUucHJvdG9idWYuVmFsdWUSNAoQbGlzdF92YWx1ZV9maWVsZBgNIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5MaXN0VmFsdWUSNAoQbnVs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gBIAEoCBIhCgV2YWx1ZRgCIAEoDjISLnNwZWMuSnNvblR5cGVFbnVtOgI4ASpdCgxKc29uVHlwZUVudW0SHgoaSlNPTl9UWVBFX0VOVU1fVU5TUEVDSUZJRUQQABIWChJKU09OX1RZUEVfRU5VTV9ZRVMQARIVChFKU09OX1RZUEVfRU5VTV9OTxACYgZwcm90bzM", [file_google_protobuf_any, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp, file_google_protobuf_wrappers]); /** * @generated from message spec.JsonTypesMessage */ export type JsonTypesMessage = Message<"spec.JsonTypesMessage"> & { /** - * @generated from field: bool bool_field = 1; + * @generated from field: bool bool_field = 1 [json_name = "booleanFieldWithCustomName"]; */ boolField: boolean; diff --git a/packages/protobuf-test/src/generate-code.test.ts b/packages/protobuf-test/src/generate-code.test.ts index 5ffb9d5e5..313a15dbb 100644 --- a/packages/protobuf-test/src/generate-code.test.ts +++ b/packages/protobuf-test/src/generate-code.test.ts @@ -97,7 +97,7 @@ test("source retention options are unavailable in generated code", () => { describe("JSON types", () => { const ok_ts: json_types_ts_json.JsonTypesMessageJson = { - boolField: true, + booleanFieldWithCustomName: true, doubleField: "Infinity", bytesField: "aGVsbG8gd29ybGQ=", int64Field: "123", @@ -109,7 +109,7 @@ describe("JSON types", () => { }; expect(ok_ts).toBeDefined(); const ok_js: json_types_js_json.JsonTypesMessageJson = { - boolField: true, + booleanFieldWithCustomName: true, doubleField: "Infinity", bytesField: "aGVsbG8gd29ybGQ=", int64Field: "123", diff --git a/packages/protobuf-test/src/json-types.test.ts b/packages/protobuf-test/src/json_types.test.ts similarity index 100% rename from packages/protobuf-test/src/json-types.test.ts rename to packages/protobuf-test/src/json_types.test.ts