Skip to content

Commit

Permalink
fix with corner cases in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangsa committed Dec 19, 2024
1 parent 35271c4 commit e862bb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class {{serviceName}}ApiController implements {{serviceName}}Api {

@Override
public ResponseEntity<{{{responseEntityExpression}}}> {{operationId}}({{{methodParameters}}}) {
log.debug("REST request to {{operationId}}: {{methodParameterPlaceholders}}", {{methodParameterInstances}});
log.debug("REST request to {{operationId}}: {{methodParameterPlaceholders}}"{{#if methodParameters}}, {{methodParameterInstances}}{{/if}});
{{~#if (eq httpMethod 'patch')~}}
{{~else if requestBodySchema~}}
var {{mappedInputVariable}} = mapper.as{{serviceMethodParameter}}({{reqBodyVariableName}});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ protected Object generateObject(String propertyName, Map<String, Object> schema)

protected Object generateValue(String propertyName, Map<String, Object> schemaNode) {
String type = (String) schemaNode.get("type");
if ((type == null)) {
return null;
}

return switch (type) {
case "string" -> generateString(propertyName, schemaNode);
Expand Down

0 comments on commit e862bb5

Please sign in to comment.