Skip to content

Commit b45de0b

Browse files
committed
adding parameter to support path generation for GET method or full crud respecting setting on YANG config attribute.
Changing behaviour - by default full CRUD is generated from this version on.
1 parent b189469 commit b45de0b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.amartus.y2s</groupId>
88
<artifactId>yang2swagger-tapi-cli</artifactId>
9-
<version>1.2</version>
9+
<version>1.3</version>
1010
<properties>
1111
<y2s.version>1.1.9</y2s.version>
1212
</properties>

src/main/java/com/amartus/y2s/Generator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public class Generator {
7070
@Option(name = "-authentication", usage="Authentication definition")
7171
public AuthenticationMechanism authenticationMechanism = AuthenticationMechanism.NONE;
7272

73+
@Option(name = "-fullCrud", usage="If the flag is set to false path are generated for GET operations only. Default true")
74+
public boolean fullCrud = true;
75+
7376
OutputStream out = System.out;
7477

7578
public enum AuthenticationMechanism {
@@ -113,7 +116,11 @@ protected void generate() throws IOException, ReactorException {
113116
.collect(Collectors.toSet());
114117

115118

116-
PathHandlerBuilder pathHandler = new PathHandlerBuilder().withoutFullCrud();
119+
PathHandlerBuilder pathHandler = new PathHandlerBuilder();
120+
if(!fullCrud) {
121+
pathHandler.withoutFullCrud();
122+
}
123+
117124
if(useNamespaces)
118125
pathHandler = pathHandler.useModuleName();
119126

0 commit comments

Comments
 (0)