-
Notifications
You must be signed in to change notification settings - Fork 26
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
Adding 'new_record' field for all schemas #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,5 @@ target/ | |
|
||
CHANGELOG | ||
AUTHORS | ||
|
||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#!/usr/bin/env node | ||
//requires the json-schema-faker npm package installed | ||
var jsf = require('json-schema-faker') | ||
var fs = require('fs', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fs and path were already loaded by node on my installation when running it, sorry if it did not worked for you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Argh! I wonder how that happened... |
||
jsf = require('json-schema-faker'), | ||
path = require('path'); | ||
|
||
jsf.format('ISO 639-1', function(gen, schema){ return gen.randexp('^1.*$');}); | ||
jsf.format('date', function(gen, schema){ return gen.randexp('^1.*$');}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,9 @@ | |
"value": ")qk,t/ [((>?! oOEE=a8uIb\"u5V_J@/%qmn&YH,:1:stA@z}TNi/lrF{*X;YBt-e=J*AFmNsTF_(4[dtSFMpIWt1*:pA, UZ~oG)`hd5AYA.FW@M-Wq3+ag7a\\:J~4(3aIM7mbYg;5yOSyv,S?Az`ncWRH{cBAv`L%jEsmY" | ||
}, | ||
"native_name": [], | ||
"new_record": { | ||
"$ref": "1M\"?!ouZ]W}^ 6ZBtT (OpV2~FoO1*YXan`6q+Zz{|E}b&Rty<P]6o0i)l[,YDwm4_9c}HnG.:l_H" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What!? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something got currputed here... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah no. I see that this is an example fixture... :) |
||
}, | ||
"other_names": [ | ||
"ad non", | ||
"sed cupidatat Duis ut", | ||
|
@@ -176,4 +179,4 @@ | |
"value": "1*jBK`<gem?+ j`1T|$;b<Q%;8?+" | ||
} | ||
] | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @david-caro, do we care about EOL here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this would be solved by also transferring my little schema-linters tools: https://github.com/inspirehep/inspire-next/blob/master/scripts/prettify_json There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really care, I see no reason to complain about it, but if you give me a reason to avoid it I'll follow, automating as @kaplun says would be the best though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I asked because it looked like you took care of avoiding EOLs, so I wasn't sure if there was a reason for that. I don't care either, they can stay. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's what the js script generated 'as is' :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now these will stay, but I really don't like
title
s that repeat the field name, anddescription
s which leave me more confused than before (what is a master record?).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @spirosdelviniotis copied from the original schema (hep) that already had this field, beside being this
$ref
the description and title fields will be overwritten by whatever referenced (a bit of a sad functionality of jsonschema).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, I didn't know that!