Categories
Mastering Development

Using BOTH scalar values and JSON objects as JSON values

I have a local table variable that I’m trying to populate with JSON key-value pairs. Sometimes the values are themselves JSON strings DECLARE @Values TABLE ( JsonKey varchar(200), JsonValue varchar(max) ) An example of what this ends up looking like: +———+————————————–+ | JsonKey | JsonValue | +———+————————————–+ | foo | bar | | foo | […]

Categories
Development

Left_join fill NA entries with data values from the second dataframe

I have two fairly complicated data.frames and managed to simplify the first step of my problem here. I have a reference table and another that contains my data as follows: REFERENCE ref <- structure(list(group = c(“A”, “B”, “C”), position = c(“a”, “a”, “b”)), row.names = c(NA, -3L), class = c(“tbl_df”, “tbl”, “data.frame”)) DATA df <- […]

Categories
Development JSON

how to parse nested json in scala

Goal: I am trying to parse the following HAR format to a postman_collection json, and persist the result into json in disk. I need to do the same from postman_collection to HAR format, but lets start with the HAR first. example HAR format used to import data and describe HTTP calls from: https://github.com/Kong/httpsnippet { “queryString”: […]

Categories
Development JSON

how to parse nested json in scala

Goal: I am trying to parse the following HAR format to a postman_collection json. example HAR format used to import data and describe HTTP calls from: https://github.com/Kong/httpsnippet { “queryString”: [ { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “method”: “POST”, “url”: “http://mockbin.com/har?key=value”, “httpVersion”: “HTTP/1.1”, “queryString”: [ { “name”: “foo”, “value”: […]

Categories
Development JSON

how to parse nested json in scala

I am trying to implement a parser between a postman collection json and the HAR json as in the following example json. It should work in both directions, e.g. from postman collection to HAR and HAR to postman collection. example HAR format used to import data and describe HTTP calls from: https://github.com/Kong/httpsnippet { “queryString”: [ […]

Categories
Development JSON

how to parse nested json in scala

{ “queryString”: [ { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “method”: “POST”, “url”: “http://mockbin.com/har?key=value”, “httpVersion”: “HTTP/1.1”, “queryString”: [ { “name”: “foo”, “value”: “bar” }, { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “headers”: [ { “name”: “accept”, “value”: “application/json” }, { “name”: “content-type”, “value”: […]

Categories
Development JSON

how to parse nested json in scala

{ “queryString”: [ { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “method”: “POST”, “url”: “http://mockbin.com/har?key=value”, “httpVersion”: “HTTP/1.1”, “queryString”: [ { “name”: “foo”, “value”: “bar” }, { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “headers”: [ { “name”: “accept”, “value”: “application/json” }, { “name”: “content-type”, “value”: […]

Categories
Development JSON

how to parse nested json in scala

{ “queryString”: [ { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “method”: “POST”, “url”: “http://mockbin.com/har?key=value”, “httpVersion”: “HTTP/1.1”, “queryString”: [ { “name”: “foo”, “value”: “bar” }, { “name”: “foo”, “value”: “baz” }, { “name”: “baz”, “value”: “abc” } ], “headers”: [ { “name”: “accept”, “value”: “application/json” }, { “name”: “content-type”, “value”: […]

Categories
Development

Ansible: How to get hosts from tags in dynamic inventory

Disclaimer: I’m new to ansible and couldn’t find an answer here, here or here. I need to run a playbook against 2 hosts. I understand how to do that with a static inventory in yaml or INI format, but I’m lost when trying it using a dynamic inventory–specifically, VMWare dynamic inventory – vmware_inventory.py . The […]

Categories
Development JSON

Flatten JSON array in Jolt Transform

Input: [ { “name”: “Foo”, “ratings”: [ { “value”: 2 }, { “value”: 4 } ] } ] Spec: [ { “operation”: “shift”, “spec”: { “*”: { “ratings”: { “@”: “” } } } } ] Output: [ { “value” : 2 }, { “value” : 4 } ] What I want to achieve: [ […]