given a JSON path that points to a string value, this plugin will scan the the associated API Resources of the API Namespace it is run against to output a unique list of API Resources to a target API Namespace
NA since it runs on an existing Namespace
resolve_string_path
: "api_namespace_slug.some_property.another_property"
output_api_namespace
: "api_namespace_slug"
pristine
: boolean
resolve_string_path
's api_namespace_slug
should be the same API Namespace the External API Connection is running on.resolve_string_path
's "api_namespace_slug" and output_api_namespace
's "api_namespace_slug" are the samepristine
is set to true
, collect all ID's of all existing API Resources in the target API Namespace and delete them after successful connection executionif pristine
is set to true
: calculate all the ID's of the API resources to delete in the target API Namespace, assign that to a variable
Access the resolve_string_path
in the current API Namespace, and loop over all the API Resources building a hash map of it.
Take the hash map and loop over the keys creating an API Resource in the target namespace for each key. The created API Resources should have the following format:
property_name
(derived form "api_namespace_slug.some_property.another_property" inresolve_string_path
)
{
`property_name`: "string value"
}
API Namespace: Movies
title: 'titanic',
tags: ['romance', 'shipbuilding']
given an API Namespace of movies, build a unique list of tags that each movie is tagged under.
@Sushmit1997 have you had a chance to take a look at this?
I've posted estimate for this task in my backlog.
@donrestarone
In logic number 1, what does assign that to a variable
means?
And I didn't get logic number 3
CC @Pralish @alis-khadka
@Sushmit1997
Example:
API Namespace: Movies attributes: title, tags (array)
title: Titanic tags: ['romance', ships]
title: Hunt for Red October tags: ['cold war', 'ships']
title: Lost tags: ['fantasy']
@donrestarone What exactly do you mean by hash map?
Is it the array of something like
title: Hunt for Red October
tags: ['cold war', 'ships']
and can you give an example of logic 3? It would be easier to understand with clear example.
@Sushmit1997 its a hash (see corrected). It maps as follows:
{
'cold war' => [API_RESOURCE_IDS],
'fantasy' => [API_RESOURCE_IDS],
}
The API_RESOURCE_IDS
above are the API_RESOURCE_IDS
of the movies Titanic, Lost etc
Is it necessary to build a hash? Our aim is to look at all the array values of one property of each API resource and then generate an array of unique values.