Skip to content

Commit

Permalink
fixed api and controller template. added package to config
Browse files Browse the repository at this point in the history
  • Loading branch information
myznikov committed Feb 14, 2025
1 parent 547278b commit 769543e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Templates/v2/Java/api.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public interface {{ service.name }}Api {
@ResponseStatus(HttpStatus.NO_CONTENT)
{%- endif %}
@{{ operation.httpMethod|capitalizeFirstLetter }}Mapping("{{ path.path }}")
{%- if operation.responseGenerationModel.key != "204" %}
@NotNull
{%- endif %}
{%- if operation.httpMethod|lowercase == "delete" %}
void{% else %}
ResponseEntity<{{ operation.responseGenerationModel.value.typeNames|join }}>
Expand Down
2 changes: 2 additions & 0 deletions Templates/v2/Java/config/java.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ useNewNullableDeterminationStrategy: false
prefixesToCutDownInServiceNames:
- /api/v1.1
- /api/1.1
environment:
package:

analytcsConfig:
logstashEnpointURI: http://logs.ps.surfstudio.ru
Expand Down
3 changes: 0 additions & 3 deletions Templates/v2/Java/controller.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public class {{ service.name }}Controller implements {{ service.name }}Api {
{%- for operation in path.operations%}

@Override
{%- if operation.responseGenerationModel.key != "204" %}
@NotNull
{%- endif %}
public {% if operation.responseGenerationModel.key == "204" %}void{% else %}ResponseEntity<{{ operation.responseGenerationModel.value.typeNames|join }}>{% endif %} {{ operation.id }}(
{%- for parameter in operation.pathParameters %}final {{ parameter.typeModel.name|capitalizeFirstLetter }} {{ parameter.name|snakeCaseToCamelCase }}
{%- if not forloop.last or operation.headerParameters or operation.queryParameters or operation.requestGenerationModel.typeNames%}, {% endif -%}{% endfor -%}
Expand Down

0 comments on commit 769543e

Please sign in to comment.