I have a massive JSON setup file that I use with one of my projects. I would like to write some documentation and validation rules via a JSON schema so the edition of this file is easier for someone who's not familiar with it.
I want to be able to open the json setup file in Eclipse and have autocomplete for the json properties via intellisense. I also want to see the documentation comments for any json setup property when the mouse is over it.
I can't find any kind of documentation about this feature. Is this possible with eclipse?
I will answer my own question, cause I found the way to do it pretty easy and works quite well.
So,
· Having a test.json file which contains the setup of your project which
you want to get autocomplete features on
· Having a c:\test.schema.json file which contains the schema for your
setup file
The steps to activate this feature on eclipse are:
1- Open eclipse
2- go to "Window > Preferences: JSON > JSON Catalog"
3- add a new entry with "test.json" as the file and
"file:/c:/test.schema.json" as the URL
4- enable syntax and schema validation under "Window > Preferences:
JSON > JSON Files > Validation"
5- Apply the changes
6- Open the test.json file with eclipse and check that ctrl + space performs autocomplete
The only tedious part of this process that I've found is that every time the json schema file gets modified, you have to go again to "Window > Preferences: JSON > JSON Catalog" and apply the changes again to refresh the new values
Related
I often use Vs code to open json files. sometimes there're some comments in my json files. in this case,there will be a lot of warnings.
So I click below button to change the format to "json with comment (jsonc)"
but when I open a JSON file next time, it will by default switch to JSON format (without comment)
How can I make 'jsonc' the default format of json file? so that I do not need to change it every time.
Thanks
You can set a file association between json files and jsonc language formatting.
In VS Code open Settings in JSON view by using the Command Pallet (Cmd + Shift + P) and enter Preferences: Open Settings (JSON). Next, add the following (or append to the existing files.associations object if it already exists):
"files.associations": {
"*.json": "jsonc"
}
I have a Java code using selenium where I have a properties file which is in JSON format with multiple values and I want to use that file in Jenkins. For that I am using "This project is parameterized" option where I am selecting "File parameters" option.
So My question is How to use the JSON format in Jenkins? Am I doing is correct and what changes we have to make in code for that?
Can anyone help on this?
The "File parameters" is not working in the way you think, it is not like Jenkins will parse file and give you something like key/value map - no.
What is it doing is follwoing , you basically upload file and then how you use it is up to you, so in other words, if that file is for you java code, set the path for that file using the JVM params (e.g. -DpropertiesFilePath = ${abc.xyz}) and then Jenkins will parse the ${abc.xyz} for you and you java code will have proper path to file.
Otherwise, if you want to use the properties inside that JSON file itself for jenkins job configuration needs, then you have to write Jenkins job using either DSL or Jenkinsfile, in which having full access to file you can use for example JsonSlupper and parse Json file and assign properties to stages or whatever you need in Jenkins job walkthrow.
I've been trying to find the documentation for populating a DAG instance using JSON. Is there formal documentation to the format somewhere?
JSON application spec is available under http://apex.apache.org/docs/apex/application_development/#json-file-dag-specification
At the current moment JSON application creation is enabled with dtAssemble, a beta feature of DataTorrent RTS. The documentation for using dtAssemble to create JSON apps is available under http://docs.datatorrent.com/dtassemble/
You can experiment with dtAssemble, and inspect the PUT operations of /ws/v2/appPackages/[user]/[package]/[version]/applications/[application] service call to see the JSON structure generated for the application you're building. You can also download the application package where the app is being saved, unzip it, and inspect app/*.json files added there.
How do I convert Swagger JSON to RAML/YAML and validate it? I am not looking for a programmatic way, just a one off conversion.
Here are the steps:
Export Swagger JSON into a file on your drive. This JSON should be published on your server at the following URI: /swagger/docs/v1
Go to http://editor.swagger.io/#/
On the top left corner, select File-> Import File... Point to the local Swagger JSON file you exported in step #1 to open in the Swagger Editor
Select Generate Client -> Swagger YAML option from the menu
It will generate the YAML that you can validate at http://www.yamllint.com/ site
To convert API spec between various formats (e.g. Swagger/OpenAPI, RAML, Postman, etc), you can use the following free and open source tools:
https://github.com/lucybot/api-spec-converter
https://github.com/stoplightio/api-spec-converter
Its actually pretty simple
Web version of swagger editor gives the flexibility to import your existing swagger file(JSON/YAML) and download the configuration file that is currently being shown. So just combine these two.
Note: Converting JSON to YAML exists, but not JSON to RAML
First import your swagger JSON at http://editor.swagger.io/#/ (File > Import File)
Once you see your configurations, just download the corresponding YAML version (File > Download YAML).
The YAML version of the JSON you just uploaded will be downloaded.
Conversion
If you are looking to convert from any version Swagger to RAML 0.8 then APITransformer.com can do it for you. We're almost done with RAML 1.0 export. Will release it in a week's time.
Validation
The converted description comes out of the same code-gen engine that APIMatic uses to validate an API description before generating SDKs/Client libraries. Therefore, the converted RAML will be validated by default.
API descriptions in a variety of formats can also be validated via APIMatic's CLI or APIMatic's API
While I wish there was a command line tool, this company has made a converter it seems:
https://apitransformer.com/
I am using ubantu and trying to configure ctags on sublime text 2 for rails.
I am getting the above error message on opening my sublime text.
On re building ctags its completing within a flash without generating a .ctag file in the specified location.
My guess is that is an empty file right now. Open the file (possibly through another editor) and insert {}. The settings files are JSON objects. That just looks like it's failing the JSON parse.
You could run cat ~/.config/sublime-text-2/Packages/User/CTags.sublime-settings to see if there is anything in the file. If there is not you could freely delete it.
Though this error could be caused by a plugin that requires some configuration looking for its preferences file and failing.