Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions calm-hub/nitrite/init-nitrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ post_document() {
local http_code
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$CALM_HUB_URL/api/calm/namespaces/$namespace/$resource" \
-H "$CONTENT_TYPE" \
-d "$payload")
--data-binary @- <<< "$payload")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same -d "$payload" pattern is still used for six other variable-size bodies: schemas (L122), standards (L5209), interfaces (L5248), controls (L5330), timeline (L6007) and layout (L6180). The schema POST is the closest to the same limit: the draft 2026-03 meta set is already ~23 KB. Worth switching those to --data-binary @- <<< "$payload" here too so the script has one mechanism for variable payloads. The three inline literal bodies (namespaces, user-access, domains) are tiny and can stay as they are.


if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then
print_status "Created $resource '$name' in namespace $namespace"
Expand Down Expand Up @@ -217,7 +217,7 @@ post_named_document() {
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
"$CALM_HUB_URL/calm/namespaces/$namespace/$resource/$slug/versions/$version" \
-H "$CONTENT_TYPE" \
-d "$payload")
--data-binary @- <<< "$payload")

if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then
print_status "Created $resource '$slug' version $version in namespace $namespace"
Expand Down Expand Up @@ -263,7 +263,7 @@ post_architecture_version() {
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
"$CALM_HUB_URL/api/calm/namespaces/$namespace/architectures/$architecture_id/versions/$version" \
-H "$CONTENT_TYPE" \
-d "$payload")
--data-binary @- <<< "$payload")

if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then
print_status "Created architecture '$name' version $version in namespace $namespace"
Expand Down Expand Up @@ -297,7 +297,7 @@ post_pattern_version() {
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
"$CALM_HUB_URL/api/calm/namespaces/$namespace/patterns/$pattern_id/versions/$version" \
-H "$CONTENT_TYPE" \
-d "$payload")
--data-binary @- <<< "$payload")

if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then
print_status "Created pattern '$name' version $version in namespace $namespace"
Expand Down
Loading