Skip to content

Commit

Permalink
Use the format uri from the JSON Schema spec with an upload option fo…
Browse files Browse the repository at this point in the history
…r binary upload
  • Loading branch information
Andre Kampert committed Aug 19, 2014
1 parent 68f8427 commit 0839ed2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions examples/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ <h1>JSON Editor Upload Example</h1>
type: "object",
title: "Image",
properties: {
href: {
uri: {
type: "string",
format: "uploadUri"
format: "uri",
options: {
upload: true
}
},
name: {
type: "string"
Expand Down
3 changes: 1 addition & 2 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) {
});
// Editor for uploading files
JSONEditor.defaults.resolvers.unshift(function(schema) {
// If the schema can be of any type
if(schema.type === "string" && schema.format === "uploadUri") {
if(schema.type === "string" && schema.format === "uri" && schema.options && schema.options.upload === true) {
return "upload";
}
});
Expand Down

0 comments on commit 0839ed2

Please sign in to comment.