Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default unknown type to simple type=object schema (1.1.x) #362

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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