diff --git a/bin/configs/protobuf-schema-config.yaml b/bin/configs/protobuf-schema-config.yaml index 44ae7540fd8..5000698d79f 100644 --- a/bin/configs/protobuf-schema-config.yaml +++ b/bin/configs/protobuf-schema-config.yaml @@ -8,6 +8,7 @@ additionalProperties: numberedFieldNumberList: true startEnumsWithUnspecified: true wrapComplexType: false + aggregateModelsName: data typeMappings: object: "google.protobuf.Struct" importMappings: diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index e24f09db29d..f05d48eabd8 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -19,6 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |addJsonNameAnnotation|Append "json_name" annotation to message field when the specification name differs from the protobuf field name| |false| +|aggregateModelsName|Aggregated model filename. If set, all generated models will be combined into this single file.| |null| |numberedFieldNumberList|Field numbers in order.| |false| |startEnumsWithUnspecified|Introduces "UNSPECIFIED" as the first element of enumerations.| |false| |wrapComplexType|Generate Additional message for complex type| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 78938f1cacf..362249ab3be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -42,6 +42,8 @@ import java.io.File; import java.util.*; import java.util.Map.Entry; import java.util.regex.Pattern; +import java.util.stream.Collectors; + import com.google.common.base.CaseFormat; import static org.openapitools.codegen.utils.StringUtils.*; @@ -64,10 +66,14 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf public static final String WRAP_COMPLEX_TYPE = "wrapComplexType"; + public static final String AGGREGATE_MODELS_NAME = "aggregateModelsName"; + private final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class); @Setter protected String packageName = "openapitools"; + @Setter protected String aggregateModelsName = null; + private boolean numberedFieldNumberList = false; private boolean startEnumsWithUnspecified = false; @@ -186,6 +192,7 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf addSwitch(START_ENUMS_WITH_UNSPECIFIED, "Introduces \"UNSPECIFIED\" as the first element of enumerations.", startEnumsWithUnspecified); addSwitch(ADD_JSON_NAME_ANNOTATION, "Append \"json_name\" annotation to message field when the specification name differs from the protobuf field name", addJsonNameAnnotation); addSwitch(WRAP_COMPLEX_TYPE, "Generate Additional message for complex type", wrapComplexType); + addOption(AGGREGATE_MODELS_NAME, "Aggregated model filename. If set, all generated models will be combined into this single file.", null); } @Override @@ -228,6 +235,10 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf this.wrapComplexType = convertPropertyToBooleanAndWriteBack(WRAP_COMPLEX_TYPE); } + if (additionalProperties.containsKey(AGGREGATE_MODELS_NAME)) { + this.setAggregateModelsName((String) additionalProperties.get(AGGREGATE_MODELS_NAME)); + } + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); } @@ -650,7 +661,35 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf .forEach(importFromList -> this.addImport(objs, parentCM, importFromList)); } } - return objs; + return aggregateModelsName == null ? objs : aggregateModels(objs); + } + + /** + * Aggregates all individual model definitions into a single entry. + * + * @param objs the original map of model names to their respective entries + * @return a new {@link Map} containing a single entry keyed by {@code aggregateModelsName} with + * combined models and imports from all provided entries + */ + public Map aggregateModels(Map objs) { + Map objects = new HashMap<>(); + ModelsMap aggregateObj = objs.values().stream() + .findFirst() + .orElse(new ModelsMap()); + + List models = objs.values().stream() + .flatMap(modelsMap -> modelsMap.getModels().stream()) + .collect(Collectors.toList()); + + Set> imports = objs.values().stream() + .flatMap(modelsMap -> modelsMap.getImports().stream()) + .filter(importMap -> !importMap.get("import").startsWith("models/")) + .collect(Collectors.toSet()); + + aggregateObj.setModels(models); + aggregateObj.setImports(new ArrayList<>(imports)); + objects.put(this.aggregateModelsName, aggregateObj); + return objects; } public void addImport(Map objs, CodegenModel cm, String importValue) { @@ -907,6 +946,11 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf } } + if (this.aggregateModelsName != null) { + List> aggregate_imports = Collections.singletonList(Collections + .singletonMap(IMPORT, toModelImport(this.aggregateModelsName))); + objs.setImports(aggregate_imports); + } return objs; } diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index df6b8af644c..817bb5f1e60 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -50,4 +50,5 @@ import public "{{{.}}}.proto"; } {{/isEnum}} {{/model}} + {{/models}} diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/cat.proto b/samples/config/petstore/protobuf-schema-config-complex/models/cat.proto index e3c752c6e07..e95c17eceb3 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/cat.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/cat.proto @@ -20,3 +20,4 @@ message Cat { int32 age = 2; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/category.proto b/samples/config/petstore/protobuf-schema-config-complex/models/category.proto index 474de2d21b7..0f5c91ab8c9 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/category.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/category.proto @@ -23,3 +23,4 @@ message Category { map document = 3; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/dog.proto b/samples/config/petstore/protobuf-schema-config-complex/models/dog.proto index ced49dd8d38..e9849273a8b 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/dog.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/dog.proto @@ -28,3 +28,4 @@ message Dog { Breed breed = 2; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/pet.proto b/samples/config/petstore/protobuf-schema-config-complex/models/pet.proto index 6709a6305b7..aba89d8b701 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/pet.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/pet.proto @@ -21,3 +21,4 @@ message Pet { Category category = 2; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/string_array.proto b/samples/config/petstore/protobuf-schema-config-complex/models/string_array.proto index 33eca76926b..6668565c5bc 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/string_array.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/string_array.proto @@ -18,3 +18,4 @@ message StringArray { repeated string string_array = 1; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/string_map.proto b/samples/config/petstore/protobuf-schema-config-complex/models/string_map.proto index a960282efad..d83f8caee83 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/string_map.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/string_map.proto @@ -18,3 +18,4 @@ message StringMap { map string_map = 1; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/tag.proto b/samples/config/petstore/protobuf-schema-config-complex/models/tag.proto index 761bd8e4f86..ba7093baae3 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/tag.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/tag.proto @@ -21,3 +21,4 @@ message Tag { TagName name = 2; } + diff --git a/samples/config/petstore/protobuf-schema-config-complex/models/tag_name.proto b/samples/config/petstore/protobuf-schema-config-complex/models/tag_name.proto index 2cd25e06115..aa4f11e22d1 100644 --- a/samples/config/petstore/protobuf-schema-config-complex/models/tag_name.proto +++ b/samples/config/petstore/protobuf-schema-config-complex/models/tag_name.proto @@ -23,3 +23,4 @@ message TagName { StringMap map = 3; } } + diff --git a/samples/config/petstore/protobuf-schema-config/.openapi-generator/FILES b/samples/config/petstore/protobuf-schema-config/.openapi-generator/FILES index f4da595c7e4..5047df3f239 100644 --- a/samples/config/petstore/protobuf-schema-config/.openapi-generator/FILES +++ b/samples/config/petstore/protobuf-schema-config/.openapi-generator/FILES @@ -1,15 +1,5 @@ README.md -models/api_response.proto -models/cat.proto -models/category.proto -models/dog.proto -models/order.proto -models/other_test.proto -models/pet.proto -models/pets_get_request.proto -models/pets_post_request.proto -models/tag.proto -models/user.proto +models/data.proto services/default_service.proto services/pet_service.proto services/store_service.proto diff --git a/samples/config/petstore/protobuf-schema-config/models/api_response.proto b/samples/config/petstore/protobuf-schema-config/models/api_response.proto deleted file mode 100644 index 6236264f976..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/api_response.proto +++ /dev/null @@ -1,24 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message ApiResponse { - - int32 code = 1; - - string type = 2; - - string message = 3; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/cat.proto b/samples/config/petstore/protobuf-schema-config/models/cat.proto deleted file mode 100644 index e3c752c6e07..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/cat.proto +++ /dev/null @@ -1,22 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message Cat { - - bool hunts = 1; - - int32 age = 2; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/category.proto b/samples/config/petstore/protobuf-schema-config/models/category.proto deleted file mode 100644 index 9db08ccdc54..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/category.proto +++ /dev/null @@ -1,22 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message Category { - - int64 id = 1; - - string name = 2; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/data.proto b/samples/config/petstore/protobuf-schema-config/models/data.proto new file mode 100644 index 00000000000..0a3854cdef4 --- /dev/null +++ b/samples/config/petstore/protobuf-schema-config/models/data.proto @@ -0,0 +1,159 @@ +/* + OpenAPI Petstore + + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + The version of the OpenAPI document: 1.0.0 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + +import public "google/protobuf/struct.proto"; + +message ApiResponse { + + int32 code = 1; + + string type = 2; + + string message = 3; + +} + +message Cat { + + bool hunts = 1; + + int32 age = 2; + +} + +message Category { + + int64 id = 1; + + string name = 2; + +} + +message Dog { + + bool bark = 1; + + enum Breed { + BREED_UNSPECIFIED = 0; + BREED_DINGO = 1; + BREED_HUSKY = 2; + BREED_RETRIEVER = 3; + BREED_SHEPHERD = 4; + } + + Breed breed = 2; + +} + +message Order { + + int64 id = 1; + + int64 pet_id = 2 [json_name="petId"]; + + int32 quantity = 3; + + string ship_date = 4 [json_name="shipDate"]; + + // Order Status + enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_PLACED = 1; + STATUS_APPROVED = 2; + STATUS_DELIVERED = 3; + } + + Status status = 5; + + bool complete = 6; + + google.protobuf.Struct meta = 7; + +} + +message OtherTest { + + repeated string set_test = 1; + +} + +message Pet { + + int64 id = 1; + + Category category = 2; + + string name = 3; + + repeated string photo_urls = 4 [json_name="photoUrls"]; + + repeated Tag tags = 5; + + // pet status in the store + enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_AVAILABLE = 1; + STATUS_PENDING = 2; + STATUS_SOLD = 3; + } + + Status status = 6; + +} + +message PetsGetRequest { + + oneof pets_get_request { + Cat cat = 1; + Dog dog = 2; + } +} + +message PetsPostRequest { + + Cat cat = 1; + + Dog dog = 2; + +} + +message Tag { + + int64 id = 1; + + string name = 2; + +} + +message User { + + int64 id = 1; + + string username = 2; + + string first_name = 3 [json_name="firstName"]; + + string last_name = 4 [json_name="lastName"]; + + string email = 5; + + string password = 6; + + string phone = 7; + + // User Status + int32 user_status = 8 [json_name="userStatus"]; + +} + diff --git a/samples/config/petstore/protobuf-schema-config/models/dog.proto b/samples/config/petstore/protobuf-schema-config/models/dog.proto deleted file mode 100644 index ced49dd8d38..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/dog.proto +++ /dev/null @@ -1,30 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message Dog { - - bool bark = 1; - - enum Breed { - BREED_UNSPECIFIED = 0; - BREED_DINGO = 1; - BREED_HUSKY = 2; - BREED_RETRIEVER = 3; - BREED_SHEPHERD = 4; - } - - Breed breed = 2; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/order.proto b/samples/config/petstore/protobuf-schema-config/models/order.proto deleted file mode 100644 index 7f5283263ed..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/order.proto +++ /dev/null @@ -1,41 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - -import public "google/protobuf/struct.proto"; - -message Order { - - int64 id = 1; - - int64 pet_id = 2 [json_name="petId"]; - - int32 quantity = 3; - - string ship_date = 4 [json_name="shipDate"]; - - // Order Status - enum Status { - STATUS_UNSPECIFIED = 0; - STATUS_PLACED = 1; - STATUS_APPROVED = 2; - STATUS_DELIVERED = 3; - } - - Status status = 5; - - bool complete = 6; - - google.protobuf.Struct meta = 7; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/other_test.proto b/samples/config/petstore/protobuf-schema-config/models/other_test.proto deleted file mode 100644 index 10c41b2dbdf..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/other_test.proto +++ /dev/null @@ -1,20 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message OtherTest { - - repeated string set_test = 1; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/pet.proto b/samples/config/petstore/protobuf-schema-config/models/pet.proto deleted file mode 100644 index a4238e6a0a0..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/pet.proto +++ /dev/null @@ -1,40 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - -import public "models/category.proto"; -import public "models/tag.proto"; - -message Pet { - - int64 id = 1; - - Category category = 2; - - string name = 3; - - repeated string photo_urls = 4 [json_name="photoUrls"]; - - repeated Tag tags = 5; - - // pet status in the store - enum Status { - STATUS_UNSPECIFIED = 0; - STATUS_AVAILABLE = 1; - STATUS_PENDING = 2; - STATUS_SOLD = 3; - } - - Status status = 6; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/pets_get_request.proto b/samples/config/petstore/protobuf-schema-config/models/pets_get_request.proto deleted file mode 100644 index fbc5191fa4a..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/pets_get_request.proto +++ /dev/null @@ -1,24 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - -import public "models/cat.proto"; -import public "models/dog.proto"; - -message PetsGetRequest { - - oneof pets_get_request { - Cat cat = 1; - Dog dog = 2; - } -} diff --git a/samples/config/petstore/protobuf-schema-config/models/pets_post_request.proto b/samples/config/petstore/protobuf-schema-config/models/pets_post_request.proto deleted file mode 100644 index ae8fed2bbe4..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/pets_post_request.proto +++ /dev/null @@ -1,24 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - -import public "models/cat.proto"; -import public "models/dog.proto"; - -message PetsPostRequest { - - Cat cat = 1; - - Dog dog = 2; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/tag.proto b/samples/config/petstore/protobuf-schema-config/models/tag.proto deleted file mode 100644 index 32c6c8d77aa..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/tag.proto +++ /dev/null @@ -1,22 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message Tag { - - int64 id = 1; - - string name = 2; - -} diff --git a/samples/config/petstore/protobuf-schema-config/models/user.proto b/samples/config/petstore/protobuf-schema-config/models/user.proto deleted file mode 100644 index fe0652f631b..00000000000 --- a/samples/config/petstore/protobuf-schema-config/models/user.proto +++ /dev/null @@ -1,35 +0,0 @@ -/* - OpenAPI Petstore - - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - - The version of the OpenAPI document: 1.0.0 - - Generated by OpenAPI Generator: https://openapi-generator.tech -*/ - -syntax = "proto3"; - -package petstore; - - -message User { - - int64 id = 1; - - string username = 2; - - string first_name = 3 [json_name="firstName"]; - - string last_name = 4 [json_name="lastName"]; - - string email = 5; - - string password = 6; - - string phone = 7; - - // User Status - int32 user_status = 8 [json_name="userStatus"]; - -} diff --git a/samples/config/petstore/protobuf-schema-config/services/default_service.proto b/samples/config/petstore/protobuf-schema-config/services/default_service.proto index d04c2d4cedd..76253434823 100644 --- a/samples/config/petstore/protobuf-schema-config/services/default_service.proto +++ b/samples/config/petstore/protobuf-schema-config/services/default_service.proto @@ -13,8 +13,7 @@ syntax = "proto3"; package petstore.services.defaultservice; import "google/protobuf/empty.proto"; -import public "models/pets_get_request.proto"; -import public "models/pets_post_request.proto"; +import public "models/data.proto"; service DefaultService { rpc PetsGet (PetsGetRequest) returns (google.protobuf.Empty); diff --git a/samples/config/petstore/protobuf-schema-config/services/pet_service.proto b/samples/config/petstore/protobuf-schema-config/services/pet_service.proto index c080fb02ed0..c083e9a55cd 100644 --- a/samples/config/petstore/protobuf-schema-config/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema-config/services/pet_service.proto @@ -13,8 +13,7 @@ syntax = "proto3"; package petstore.services.petservice; import "google/protobuf/empty.proto"; -import public "models/api_response.proto"; -import public "models/pet.proto"; +import public "models/data.proto"; service PetService { rpc AddPet (AddPetRequest) returns (Pet); diff --git a/samples/config/petstore/protobuf-schema-config/services/store_service.proto b/samples/config/petstore/protobuf-schema-config/services/store_service.proto index 9efbfd76958..62c3aaf00ab 100644 --- a/samples/config/petstore/protobuf-schema-config/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema-config/services/store_service.proto @@ -13,7 +13,7 @@ syntax = "proto3"; package petstore.services.storeservice; import "google/protobuf/empty.proto"; -import public "models/order.proto"; +import public "models/data.proto"; service StoreService { rpc DeleteOrder (DeleteOrderRequest) returns (google.protobuf.Empty); diff --git a/samples/config/petstore/protobuf-schema-config/services/user_service.proto b/samples/config/petstore/protobuf-schema-config/services/user_service.proto index 119219d6fc8..888cd12a3ff 100644 --- a/samples/config/petstore/protobuf-schema-config/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema-config/services/user_service.proto @@ -13,7 +13,7 @@ syntax = "proto3"; package petstore.services.userservice; import "google/protobuf/empty.proto"; -import public "models/user.proto"; +import public "models/data.proto"; service UserService { rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty); diff --git a/samples/config/petstore/protobuf-schema/models/api_response.proto b/samples/config/petstore/protobuf-schema/models/api_response.proto index 96f87652913..1740c085224 100644 --- a/samples/config/petstore/protobuf-schema/models/api_response.proto +++ b/samples/config/petstore/protobuf-schema/models/api_response.proto @@ -22,3 +22,4 @@ message ApiResponse { string message = 418054152; } + diff --git a/samples/config/petstore/protobuf-schema/models/cat.proto b/samples/config/petstore/protobuf-schema/models/cat.proto index e03098050fa..e8e99abc627 100644 --- a/samples/config/petstore/protobuf-schema/models/cat.proto +++ b/samples/config/petstore/protobuf-schema/models/cat.proto @@ -20,3 +20,4 @@ message Cat { int32 age = 96511; } + diff --git a/samples/config/petstore/protobuf-schema/models/category.proto b/samples/config/petstore/protobuf-schema/models/category.proto index 7c05a10a8f6..3fa40630d27 100644 --- a/samples/config/petstore/protobuf-schema/models/category.proto +++ b/samples/config/petstore/protobuf-schema/models/category.proto @@ -20,3 +20,4 @@ message Category { string name = 3373707; } + diff --git a/samples/config/petstore/protobuf-schema/models/dog.proto b/samples/config/petstore/protobuf-schema/models/dog.proto index 149370c2afd..521f8f6120d 100644 --- a/samples/config/petstore/protobuf-schema/models/dog.proto +++ b/samples/config/petstore/protobuf-schema/models/dog.proto @@ -27,3 +27,4 @@ message Dog { Breed breed = 94001524; } + diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index c8df611f89b..32f3d6fa0ae 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -38,3 +38,4 @@ message Order { google.protobuf.Struct meta = 3347973; } + diff --git a/samples/config/petstore/protobuf-schema/models/other_test.proto b/samples/config/petstore/protobuf-schema/models/other_test.proto index 2c6d6b7e5f3..7c60306287e 100644 --- a/samples/config/petstore/protobuf-schema/models/other_test.proto +++ b/samples/config/petstore/protobuf-schema/models/other_test.proto @@ -18,3 +18,4 @@ message OtherTest { repeated string set_test = 341814865; } + diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index 6b92c3d61f4..1a3060b01ef 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -37,3 +37,4 @@ message Pet { Status status = 355610639; } + diff --git a/samples/config/petstore/protobuf-schema/models/pets_get_request.proto b/samples/config/petstore/protobuf-schema/models/pets_get_request.proto index 40dc11586d6..ab3a3e9689b 100644 --- a/samples/config/petstore/protobuf-schema/models/pets_get_request.proto +++ b/samples/config/petstore/protobuf-schema/models/pets_get_request.proto @@ -22,3 +22,4 @@ message PetsGetRequest { Dog dog = 99644; } } + diff --git a/samples/config/petstore/protobuf-schema/models/pets_post_request.proto b/samples/config/petstore/protobuf-schema/models/pets_post_request.proto index d77af7e8a18..ed34586613a 100644 --- a/samples/config/petstore/protobuf-schema/models/pets_post_request.proto +++ b/samples/config/petstore/protobuf-schema/models/pets_post_request.proto @@ -22,3 +22,4 @@ message PetsPostRequest { Dog dog = 99644; } + diff --git a/samples/config/petstore/protobuf-schema/models/tag.proto b/samples/config/petstore/protobuf-schema/models/tag.proto index bd7a9934166..eae0aa13141 100644 --- a/samples/config/petstore/protobuf-schema/models/tag.proto +++ b/samples/config/petstore/protobuf-schema/models/tag.proto @@ -20,3 +20,4 @@ message Tag { string name = 3373707; } + diff --git a/samples/config/petstore/protobuf-schema/models/user.proto b/samples/config/petstore/protobuf-schema/models/user.proto index 4d3f68b1c4e..7a8ed213169 100644 --- a/samples/config/petstore/protobuf-schema/models/user.proto +++ b/samples/config/petstore/protobuf-schema/models/user.proto @@ -33,3 +33,4 @@ message User { int32 user_status = 150530330; } +