Skip to content

Pass camelCase fields in json (Downstream fix)#193

Merged
yi-nuo426 merged 3 commits into
layer5io:masterfrom
CodexRaunak:downstream-casing-fix
May 18, 2026
Merged

Pass camelCase fields in json (Downstream fix)#193
yi-nuo426 merged 3 commits into
layer5io:masterfrom
CodexRaunak:downstream-casing-fix

Conversation

@CodexRaunak
Copy link
Copy Markdown
Contributor

@CodexRaunak CodexRaunak commented May 15, 2026

Notes for Reviewers

Emit the name of the keys explicitly as Hugo converts .Params.keys to lowercase

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Raunak Madan <madanraunak24@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2026-05-18 01:06 UTC

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the learning-path.json.html partial to explicitly map and format the certificate object fields into camelCase, ensuring consistency for issuing authorities and expiration data. The reviewer noted that while these changes align with the goal of using camelCase, other top-level fields in the same JSON file (such as org_id and detailed_description) still use snake_case and should be updated to maintain consistency across the entire contract.

Comment on lines +33 to +51
{{- $certificate := .Params.certificate -}}
{{- if $certificate }}
{{- $authorities := slice -}}
{{- range or (index $certificate "issuingAuthorities") (index $certificate "issuingauthorities") (index $certificate "issuing_authorities") }}
{{- $authorities = $authorities | append (dict
"name" (index . "name")
"role" (index . "role")
"signatureUrl" (or (index . "signatureUrl") (index . "signatureurl") (index . "signature_url"))
) -}}
{{- end }}
{{- $certificateJSON := dict
"title" (index $certificate "title")
"expiresIn" (or (index $certificate "expiresIn") (index $certificate "expiresin") (index $certificate "expires_in"))
"issuingAuthorities" $authorities
-}}
"certificate": {{ $certificateJSON | jsonify }},
{{- else }}
"certificate": null,
{{- end }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While this change correctly implements camelCase for the certificate object's internal fields, the rest of the JSON contract in this file still uses snake_case for several top-level and nested fields (e.g., org_id on line 23, detailed_description on line 30, total_courses on line 55, etc.). To maintain consistency and align with the project's canonical schema as per the general rules, all field names in the emitted JSON should be converted to camelCase (e.g., orgId, detailedDescription, totalCourses). Since the PR objective is to "Pass camelCase fields in json", addressing these remaining fields would ensure a complete fix for downstream consumers.

References
  1. Maintain consistency in emitted JSON contracts by using camelCase for all field names (e.g., 'orgId' instead of 'org_id') to align with the project's canonical schema.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The detailed_description have a schema drift - In downstream contract a camelCase is expected in schemas, this caused the description to be dropped in the consumer (Meshery-Cloud). I have updated it to camelCase to as per the canonical contract.

Other fields like org_id, still uses snake case in the schema contract (v1beta2), and is correctly parsed by the consumer. This would be updated when we increment meshery-cloud to use v1beta3

@yi-nuo426 yi-nuo426 merged commit 44b2814 into layer5io:master May 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants