Skip to content

Commit

Permalink
fix: always generate from latest (#326)
Browse files Browse the repository at this point in the history
* generate fetches openrpc from QCS

* generate from latest specs
  • Loading branch information
glooms authored May 15, 2024
1 parent cbbd2c3 commit 447e517
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -14392,7 +14392,7 @@
}
},
"NxDimension": {
"description": "Either qDef or qLibraryId must be set, but not both.\nIf the dimension is set in the hypercube and not in the library, this dimension cannot be shared with other objects.\nA dimension that is set in the library can be used by many objects.",
"description": "The fields or expressions in the dimension are either defined in qDef or in the master dimension referred to by qLibraryId. If qLibraryId is set then the qFieldDefs, qFieldLabels, qGrouping, qLabelExpression and qAlias of the master dimension will be used.\nIf the dimension is set in the hypercube and not in the library, this dimension cannot be shared with other objects.\nA dimension that is set in the library can be used by many objects.",
"type": "struct",
"entries": {
"AttributeDimensions": {
Expand Down Expand Up @@ -15129,7 +15129,7 @@
}
},
"NxMeasure": {
"description": "Either qDef or qLibraryId must be set, but not both.\nIf the measure is set in the hypercube and not in the library, this measure cannot be shared with other objects.\nA measure that is set in the library can be used by many objects.\n\nexpressions are complementary expressions associated to a measure. For example, you can decide to change the background color of a visualization depending on the values of the measure.\nAttribute expressions do not affect the layout of an object. The sorting order is unchanged.",
"description": "Either qDef or qLibraryId must be set, but not both. If both are set, the library measure's qDef and qLabel will be used.\nIf the measure is set in the hypercube and not in the library, this measure cannot be shared with other objects.\nA measure that is set in the library can be used by many objects.\n\nexpressions are complementary expressions associated to a measure. For example, you can decide to change the background color of a visualization depending on the values of the measure.\nAttribute expressions do not affect the layout of an object. The sorting order is unchanged.",
"type": "struct",
"entries": {
"AttributeDimensions": {
Expand Down
8 changes: 4 additions & 4 deletions qix_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions schema/engine-rpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openrpc": "1.0.0",
"info": {
"title": "QIX",
"version": "12.2064.0",
"version": "12.2073.0",
"description": "The JSON-RPC API over websocket that enables you to interact with the Qlik Associative Engine."
},
"methods": [
Expand Down Expand Up @@ -15965,7 +15965,7 @@
},
"NxDimension": {
"type": "object",
"description": "<div class=note>Either **qDef** or **qLibraryId** must be set, but not both. </div> <div class=note>If the dimension is set in the hypercube and not in the library, this dimension cannot be shared with other objects.</div> <div class=note>A dimension that is set in the library can be used by many objects.</div>",
"description": "<div class=note>The fields or expressions in the dimension are either defined in **qDef** or in the master dimension referred to by **qLibraryId**. If **qLibraryId** is set then the qFieldDefs, qFieldLabels, qGrouping, qLabelExpression and qAlias of the master dimension will be used. </div> <div class=note>If the dimension is set in the hypercube and not in the library, this dimension cannot be shared with other objects.</div> <div class=note>A dimension that is set in the library can be used by many objects.</div>",
"properties": {
"qLibraryId": {
"type": "string",
Expand Down Expand Up @@ -16358,7 +16358,7 @@
},
"NxMeasure": {
"type": "object",
"description": "<div class=note>Either **qDef** or **qLibraryId** must be set, but not both. </div> <div class=note>If the measure is set in the hypercube and not in the library, this measure cannot be shared with other objects.</div> <div class=note>A measure that is set in the library can be used by many objects.</div> <div class=note>\nexpressions are complementary expressions associated to a measure. For example, you can decide to change the background color of a visualization depending on the values of the measure.\nAttribute expressions do not affect the layout of an object. The sorting order is unchanged.\n</div>",
"description": "<div class=note>Either **qDef** or **qLibraryId** must be set, but not both. If both are set, the library measure's qDef and qLabel will be used. </div> <div class=note>If the measure is set in the hypercube and not in the library, this measure cannot be shared with other objects.</div> <div class=note>A measure that is set in the library can be used by many objects.</div> <div class=note>\nexpressions are complementary expressions associated to a measure. For example, you can decide to change the background color of a visualization depending on the values of the measure.\nAttribute expressions do not affect the layout of an object. The sorting order is unchanged.\n</div>",
"properties": {
"qLibraryId": {
"type": "string",
Expand Down Expand Up @@ -24408,8 +24408,5 @@
}
},
"x-qlik-visibility": "public",
"x-qlik-stability": "locked",
"x-qlik-categories": [
"external/manage"
]
}
"x-qlik-stability": "locked"
}
22 changes: 17 additions & 5 deletions schema/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

## compares engine spec with master

wget -q https://qlik.dev/specs/json-rpc/qix.json -O ./schema/engine-rpc.json
git diff --exit-code origin/master -- ./schema/engine-rpc.json >/dev/null
if [[ $? -ne 0 ]]; then
generate() {
if [[ $QCS_HOST == "" ]]; then
echo "QCS_HOST not set"
return 1
fi
if [[ $QCS_API_KEY == "" ]]; then
echo "QCS_API_KEY not set"
return 1
fi
curl -s -H "Authorization: Bearer $QCS_API_KEY" https://$QCS_HOST/api/engine/openrpc | jq > ./schema/engine-rpc.json
git diff --exit-code origin/master -- ./schema/engine-rpc.json >/dev/null
if [[ $? -ne 0 ]]; then
ENGINE_VERSION=$(cat ./schema/engine-rpc.json | jq -r '.info.version')
echo "Generating enigma-go based on OPEN-RPC API for Qlik Associative Engine version $ENGINE_VERSION"
## generate code
Expand All @@ -13,6 +22,9 @@ if [[ $? -ne 0 ]]; then
go fmt ./qix_generated.go >/dev/null
## generate spec
go run ./spec/generate.go
else
else
echo "No changes to engine-rpc.json, nothing to do."
fi
fi
}

generate

0 comments on commit 447e517

Please sign in to comment.