Skip to content

Commit 24ed2ab

Browse files
committed
chore: rename option for entity class and document it
1 parent 1248f43 commit 24ed2ab

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

TARGETS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ Currently the following output targets are supported:
4646
4747
###### Options
4848

49-
| Option | Default | Description |
50-
| --------- | ------- | -------------------------------- |
51-
| `indent` | ` ` | line break & indent output value |
49+
| Option | Default | Description |
50+
| ------------ | -------- | -------------------------------- |
51+
| `indent` | ` ` | line break & indent output value |
52+
| `entityType` | `String` | Java type for the entity |
5253

5354
----
5455

src/targets/java/restclient.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const multipartMimeTypes = [
6060
module.exports = function (source, options) {
6161
const opts = Object.assign({
6262
indent: ' ',
63-
entityClass: 'String'
63+
entityType: 'String'
6464
}, options)
6565

6666
const code = new CodeBuilder(opts.indent)
@@ -105,7 +105,7 @@ module.exports = function (source, options) {
105105
code.blank()
106106
}
107107

108-
code.push('ResponseEntity<%s> response = restClient', opts.entityClass)
108+
code.push('ResponseEntity<%s> response = restClient', opts.entityType)
109109

110110
if (standardMethods.includes(source.method.toUpperCase())) {
111111
code.push(1, '.method(HttpMethod.%s)', source.method.toUpperCase())
@@ -167,7 +167,7 @@ module.exports = function (source, options) {
167167
}
168168

169169
code.push(1, '.retrieve()')
170-
code.push(1, '.toEntity(%s.class);', opts.entityClass)
170+
code.push(1, '.toEntity(%s.class);', opts.entityType)
171171

172172
return code.join()
173173
}

0 commit comments

Comments
 (0)