Best tool for .json file schema validation - json

There are probably a lot of tools/libraries to validate JSON schemas.
I have a library and want users of my library to have configuration files that match the expected API.
Using Webstorm, the IDE will tell me that my Webpack config file schema is incorrect, something like this:
The Webpack files that are responsible are here:
https://github.com/webpack/webpack/blob/master/schemas/webpackOptionsSchema.json
Integration with existing IDEs like Webstorm, VSCode, Atom, ST3, etc, would be a huge plus.
I haven't figured out how to do this right...anybody know?

To integrate with various IDEs, consider uploading your json schema to JSON Schema Store.
Here is the GitHub Repo
https://github.com/SchemaStore/schemastore
This contains json schemas for many well known json files and gets integrated with Visual Studio and VS Code easily.
Also look at step by step integrations steps for Visual Studio
https://scottaddie.com/2016/08/02/community-driven-json-schemas-in-visual-studio-2015/

Related

How to download docs in markdown format?

Is there a way to download docs for projects in markdown or plaintext format? The download menu offers only rendered formats that are much harder to parse.
I can try to write a script that goes to source repos and tries to build it, but each repo might have a different build process and it's more resource intensive.

Build and validate a REST json request using a openAPI/swagger schema using VSCode

I'm using Visual Studio Code to write REST json requests, I'm validating pretty complex schemas as I type on VSCode mapping against the "json.schemas" in settings.
Lately, the REST API's grew up in complexity and I'm no longer receive a regular json schema but a YAML swagger 2.0 file.
How can I validate as I type using Intellisense and build from scratch a request in Visual Studio Code as I did it in the past? I'm trying to use OpenAPI extension on VSCode but it's not working for me. Thank you!
Installed openAPI and yaml extensions in Visual Studio Code.

electron packaged into asar target windows , config json with api key setting, is safe?

If an app is packaged with asar and the electron app uses a settings json file that I created that includes api key info... is this is a terrible idea related to security? How hard is it for someone to view this json file in plain-text?
How hard is it for someone to view this json file in plain-text?
Asar is nothing more than a simple archive, pretty much anyone can extract and read file inside.
https://github.com/electron/asar#asar---electron-archive :
it works like tar that concatenates all files together without compression

MarkLogic Java API batch upload files (.csv)

Im trying out the MarkLogic Java API and would want to bulk upload some files with the extension .csv
I'm not sure what to use, since the Java API only supports JSON, XML, and TXT files.
How do I batch upload files using the MarkLogic Java api? Do i convert everything to JSON?
Do i convert everything to JSON?
Yes, that is a common way to do it.
If you would like additional examples of how you can wrangle CSV with the Java Client API, check out OpenCSVBatcherExample and JacksonDatabindTest.testDatabindingThirdPartyPojoWithMixinAnnotations. The first demonstrates converting the csv to XML and using a custom REST extension. The second example (well, unit test...) demonstrates converting the csv to JSON and using the batch upload (Bulk Writes) capabilities Justin linked to.
If you have CSV files on your filesystem, I’d start with mlcp, as suggested above. It will handle all of the parsing and splitting into multiple transactions/batches for you. Take a look at the mlcp documentation for more details and some example configurations.
If you’d like more control over the parsing and splitting logic than mlcp gives you out-of-the-box or you’re getting CSV from some other source (i.e. not files on the filesystem), you can use the Java Client API. The Java Client API allows you to efficiently write batches using a WriteSet. Take a look at the “Bulk Writes” example.
According to your reply to Justin, you cannot use MLCP because it is command line and you need to integrate it into a web portal.
Well, MLCP is released as open cource software under the Apache2 licence. So if you are happy with this licence, then you have the source to integrate.
But what I see as your main problem statement is more specific:
How can I create miltiple XML OR JSON documents from a CSV file [allowing the use of the java API to then upload them as documents in MarkLogic]
With that specific problem statement:
1) have a look at SplitDelimitedTextReader.java from the mlcp source
2) try some java libraries for this purpose such as http://jsefa.sourceforge.net/quick-tutorial.html

How can I import JSON data from a REST API into BIRT?

I want to use BIRT to generate reports against data that comes from a JSON based REST API. How can I import this data?
The process for doing this is described at http://developer.actuate.com/community/forum/?app=blog&blogid=45&showentry=471, but it turns out that there are a few important steps missing. I'll fill in a few blanks here.
The original instructions describe creating a Scripted Data Source, with an "open" script that makes use of the com.actuate.json.JSONParser class. First, it is important to realise that this class is not part of BIRT, and needs to be manually added (along with any dependencies).
The download provided by the original instructions provides the com.actuate.json.JSONParser class, but leaves it up to you to source the dependencies. To make things easier I have reimplemented the JSONParser library in Maven, which will then download and package the dependencies for you. It also includes some bug fixes and enhancements like GZIP compression support. You can get the Maven project from https://github.com/mcasperson/birt-jsonparser, and to build the JSONParser library and package the dependencies, run the command
mvn clean package dependency:copy-dependencies
This will result in the birt-jsonparser-0.0.1-SNAPSHOT.jar file being created in the target directory, and all the dependencies copied into the target\dependency directory. Copy all of these JAR files into the {BIRT_INSTALL}/plugins/org.eclipse.birt.report.viewer_{BIRT_VIEWER_VERSION}/birt/scriptlib directory to allow the JSONParser class to be accessed from within your BIRT report.
If you want to debug your report, these JAR files will also have to be referenced in the Debug profile.