Skip to content

Commit 18bb08e

Browse files
committed
Update generated documentation.
1 parent bb35f63 commit 18bb08e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,13 @@ Methods are grouped by resource path. Parameter, body, and return types are enco
266266
* `Double` or `double`: "double"
267267
* Any other `Number`: "number"
268268
* `CharSequence`: "string"
269+
* `Enum`: "enum"
269270
* `java.util.Date`: "date"
270271
* `java.time.Instant`: "instant"
271272
* `java.time.LocalDate`: "date-local"
272273
* `java.time.LocalTime`: "time-local"
273274
* `java.time.LocalDateTime`: "datetime-local"
274-
* `java.net.URL`: "file"
275+
* `java.net.URL`: "url"
275276
* `java.lang.Iterable`: "[<em>element type</em>]"
276277
* `java.util.Map`: "[<em>key type</em>: <em>value type</em>]"
277278

httprpc-server/src/main/java/org/httprpc/WebService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ private void describeType(Type type, XMLStreamWriter xmlStreamWriter) throws XML
895895
}
896896

897897
private void describeType(Class<?> type, XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
898-
if (type.isArray() || type.isEnum()) {
898+
if (type.isArray()) {
899899
throw new IllegalArgumentException();
900900
}
901901

@@ -922,6 +922,8 @@ private void describeType(Class<?> type, XMLStreamWriter xmlStreamWriter) throws
922922
description = "boolean";
923923
} else if (CharSequence.class.isAssignableFrom(type)) {
924924
description = "string";
925+
} else if (Enum.class.isAssignableFrom(type)) {
926+
description = "enum";
925927
} else if (Date.class.isAssignableFrom(type)) {
926928
description = "date";
927929
} else if (type == Instant.class) {
@@ -933,7 +935,7 @@ private void describeType(Class<?> type, XMLStreamWriter xmlStreamWriter) throws
933935
} else if (type == LocalDateTime.class) {
934936
description = "datetime-local";
935937
} else if (type == URL.class) {
936-
description = "file";
938+
description = "url";
937939
} else {
938940
if (Iterable.class.isAssignableFrom(type)) {
939941
describeType(new ParameterizedType() {

0 commit comments

Comments
 (0)