You can install the task via FRENDS UI Task View or you can find the nuget package from the following nuget feed
https://www.myget.org/F/frends/api/v2
Clone a copy of the repo
git clone https://github.com/FrendsPlatform/Frends.Json.git
Restore dependencies
nuget restore frends.json
Rebuild the project
Run Tests with nunit3. Tests can be found under
Frends.Json.Tests\bin\Release\Frends.Json.Tests.dll
Create a nuget package
nuget pack nuspec/Frends.Json.nuspec
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
Query a json string / json token using JSONPath query.
Property | Type | Description | Example |
---|---|---|---|
Json | dynamic ( JToken / string ) | Json for the query. | {"key":"value"} |
Query | string | Query that uses JSONPath syntax. See http://goessner.net/articles/JsonPath/ for details | $.store.book[0].title $['store']['book'][0]['title'] |
Property | Type | Description |
---|---|---|
ErrorWhenNotMatched | bool | A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. |
Array [ JToken ]
Query a json string / json token for a single result
Property | Type | Description | Example |
---|---|---|---|
Json | dynamic ( JToken / string ) | Json for the query. | {"key":"value"} |
Query | string | Query that uses JSONPath syntax. See http://goessner.net/articles/JsonPath/ for details | $.store.book[0].title $['store']['book'][0]['title'] |
Property | Type | Description |
---|---|---|
ErrorWhenNotMatched | bool | A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. |
JToken
Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. See https://github.com/rexm/Handlebars.Net
Property | Type | Description | Example |
---|---|---|---|
Json | dynamic ( JToken / string ) | Object used to fill the template | {"title":"mr.", "name":"foo"} |
HandlebarTemplate | string | Template for handlebars. This needs to be in expression mode. Using {{ }} in other modes breaks the task. | <xml> {{title}} {{> strongName}} </xml> |
HandlebarPartials | Array{string TemplateName, string Template} | Partials for a handlebars template. A partial is inicated by adding a {{'>' templateName }} inside the parent HandlebarTemplate | TemplateName: "strongName", Template: "<strong>{{name}}</strong>" |
string
Validate your json with Json.NET Schema. See http://www.newtonsoft.com/jsonschema
Property | Type | Description | Example |
---|---|---|---|
Json | dynamic ( JToken / string ) | Json to be validated | {"key":"value"} |
JsonSchema | string | JsonSchema to use for validation | {"type": "object", "properties": {"key": {"type":"string"} } } |
Property | Type | Description |
---|---|---|
IsValid | bool | Indicates if the json is valid |
Errors | List | List of error messages for the validation |
Convert an XML string to JToken
Property | Type | Description |
---|---|---|
xml | string |
JToken
Convert an Json string to JToken
Property | Type | Description |
---|---|---|
json | string |
JToken
This project is licensed under the MIT License - see the LICENSE file for details