Skip to content

Commit

Permalink
fix: Added missing getter/setter on java classes that have arrays as …
Browse files Browse the repository at this point in the history
…their only property. (#32)

* Removed some verbose debug logging.

* Added missing getter/setter on java classes that have arrays as their only property.
  • Loading branch information
damaru-inc authored May 7, 2020
1 parent d6f9b39 commit 8b279bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions partials/java-class
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
{{ indent3 }}this.{{ name }} = {{ name }};
{{ indent2 }}}
{{ indent2 }}private {{ arrayType }} {{ name }};

{{ indent2 }}public {{ arrayType }} get{{ type }}() { return {{ name }}; }
{{ indent2 }}public void set{{ type }}({{ arrayType }} {{ name }}) { this.{{ name }} = {{name}}; }

{{ javaClass(type, null, schema.items().properties(), schema.items().required(), indentLevel+1, true) }}
{%- else -%} {# not an array at the top level. #}
{%- set first = true -%}
Expand Down

0 comments on commit 8b279bf

Please sign in to comment.