Skip to content

Commit

Permalink
Merge pull request #362 from fabiobrz/fabiobrz-359_default_object_sch…
Browse files Browse the repository at this point in the history
…ema_1.1.x

Default unknown type to simple type=object schema (1.1.x)
  • Loading branch information
phillip-kruger committed Jun 8, 2020
2 parents b301228 + b68622c commit 1a60b8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Schema process() {
// If top level item is not indexed
if (rootClassInfo == null && objectStack.isEmpty()) {
// If there's something on the objectStack stack then pre-scanning may have found something.
return null;
return new SchemaImpl().type(Schema.SchemaType.OBJECT);
}

// Create root node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.jboss.jandex.Index;
import org.jboss.resteasy.annotations.providers.multipart.MultipartForm;
import org.jboss.resteasy.annotations.providers.multipart.PartType;
import org.jboss.resteasy.plugins.providers.multipart.InputPart;
import org.json.JSONException;
import org.junit.Test;

Expand Down Expand Up @@ -476,6 +477,9 @@ static class Bean {
@DefaultValue("default2")
@PartType("text/plain")
String formField2;

@FormParam("data")
private InputPart data;
}

@POST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"multipart/form-data": {
"schema": {
"type": "object",
"required": [ "formField4", "f3" ],
"required": [
"formField4",
"f3"
],
"properties": {
"formField1": {
"type": "string",
Expand All @@ -45,6 +48,9 @@
"formField4": {
"type": "string",
"nullable": false
},
"data": {
"type": "object"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"description": "OK",
"content": {
"text/plain": {

"schema": {
"type": "object"
}
}
}
}
Expand Down

0 comments on commit 1a60b8d

Please sign in to comment.