-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
142 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
schema2proto-lib/src/main/java/no/entur/schema2proto/modifyproto/config/ModifyField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*- | ||
* #%L | ||
* schema2proto-lib | ||
* %% | ||
* Copyright (C) 2019 - 2020 Entur | ||
* %% | ||
* Licensed under the EUPL, Version 1.1 or – as soon they will be | ||
* approved by the European Commission - subsequent versions of the | ||
* EUPL (the "Licence"); | ||
* | ||
* You may not use this work except in compliance with the Licence. | ||
* You may obtain a copy of the Licence at: | ||
* | ||
* http://ec.europa.eu/idabc/eupl5 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the Licence is distributed on an "AS IS" basis, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the Licence for the specific language governing permissions and | ||
* limitations under the Licence. | ||
* #L% | ||
*/ | ||
package no.entur.schema2proto.modifyproto.config; | ||
|
||
public class ModifyField { | ||
/** | ||
* Name of the existing message type. | ||
*/ | ||
public String targetMessageType; | ||
|
||
/** | ||
* Name of the field on the existing message type to modify. | ||
*/ | ||
public String field; | ||
|
||
/** | ||
* Regex pattern to match in the existing documentation. If not provided, the existing documentation is completely replaced by | ||
* {@link ModifyField#documentation}. | ||
*/ | ||
public String documentationPattern; | ||
|
||
/** | ||
* Replacement string for the documentation of the existing field. Regex capturing groups from the {@link ModifyField#documentationPattern} are supported. | ||
*/ | ||
public String documentation; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
schema2proto-lib/src/test/resources/modify/expected/nopackagename/modifyfield.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// default.proto at 0:0 | ||
syntax = "proto3"; | ||
|
||
// Type for Status of termination response. | ||
message A { | ||
// [Additional documentation] Time individual response element was created. | ||
uint64 response_timestamp = 1 [(validate.rules).uint64.gte = 20]; | ||
} | ||
|
||
message B { | ||
LangType lang = 1; | ||
// Whole documentation replaced | ||
string value = 2; | ||
|
||
} | ||
|
||
enum LangType { | ||
// Default | ||
LANG_TYPE_UNSPECIFIED = 0; | ||
LANG_TYPE_A = 1; | ||
LANG_TYPE_B = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters