diff options
author | 2020-07-07 10:43:22 -0400 | |
---|---|---|
committer | 2020-07-07 10:43:22 -0400 | |
commit | 4d7315b9e723bfde1068d94a21e7ff6c049f701e (patch) | |
tree | e99c6ac3b1ee35a0584910a3706d7e66f5cc444a /graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java | |
parent | af108bdcc19cdc2cf06dacdd0705ec408bfd4910 (diff) |
correctly generate local fields when prefix has
correctly generate local fields when prefix has type and name
Issue-ID: SO-3032
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I0ba88949a136fae87850553dab5b4b80b32f9824
Diffstat (limited to 'graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java')
-rw-r--r-- | graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java b/graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java index 42305488bc..ec09af8a4e 100644 --- a/graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java +++ b/graph-inventory/fluent-builder-maven-plugin/src/main/java/org/onap/graphinventory/generate/SwaggerConverter.java @@ -125,8 +125,6 @@ public class SwaggerConverter { } } - log.debug(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(output)); - for (Map.Entry<String, ObjectType> item : output.entrySet()) { if (item.getValue().getType().equals("plural")) { @@ -156,7 +154,7 @@ public class SwaggerConverter { Matcher templates = Patterns.urlTemplatePattern.matcher(item.getValue().getPartialUri()); List<String> localFields = new ArrayList<>(); while (templates.find()) { - localFields.add(templates.group(1)); + localFields.add(templates.group(2)); } item.getValue().setFields(item.getValue().getFields().stream() .filter(f -> localFields.contains(f.getName())).collect(Collectors.toList())); @@ -166,6 +164,8 @@ public class SwaggerConverter { output.values().stream().filter(item -> item.getType().equals("plural")) .forEach(item -> item.getChildren().clear()); + log.debug(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(output)); + return output; } } |