Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def jsonString() {
- def b = new JsonBuilder()
- def jBuild = b {
- type "a"
- kind "b"
- }
- def j = new JsonSlurper().parseText('[{"name":"foo","attributes":[{"type":"x","kind":"x"}]}]')
- json << jBuild
- json = new JsonBuilder(json).toPrettyString()
- echo json
- }
- [
- {
- "name": "foo",
- "attributes": [
- {
- "type": "x",
- "kind": "x"
- }
- ]
- }
- ]""";
- {
- "type": "a",
- "kind": "b"
- }
- [
- {
- "name": "foo",
- "attributes": [
- {
- "type": "x",
- "kind": "x"
- },
- {
- "type": "a",
- "kind": "b"
- }
- ]
- }
- ]
- [
- {
- "name": "foo",
- "attributes": [
- {
- "type": "x",
- "kind": "x"
- }
- ]
- },
- {
- "type": "a",
- "kind": "b"
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement