Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note on preserving API response case style for kinds from non-asset APIs #1853

Merged
Merged
Changes from 8 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
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,44 @@ Create an integration configuration for the resource. The integration configurat
machineType: ".machineType"
# highlight-end
```



### Case Style Preservation

Certain APIs return properties in specific case styles (e.g., `camelCase`). By default, the GCP integration will convert them to `snake_case` format. However, you can preserve the original case style for the following APIs:

- Projects (`cloudresourcemanager.googleapis.com/Project`)
- Organizations (`cloudresourcemanager.googleapis.com/Organization`)
- Folders (`cloudresourcemanager.googleapis.com/Folder`)
- Topics (`pubsub.googleapis.com/Topic`)
- Subscriptions (`pubsub.googleapis.com/Subscription`)

This feature is particularly useful for ensuring compatibility with downstream systems or processes that require `camelCase` formatting.

#### How to Enable Case Style Conversion

To convert the case style to camelCase, set `preserveApiResponseCaseStyle: true` in the selector configuration for the relevant API. For example:

```yaml
- kind: pubsub.googleapis.com/Subscription
selector:
query: 'true'
preserveApiResponseCaseStyle: 'true'
port:
entity:
mappings:
identifier: .name

- kind: pubsub.googleapis.com/Topic
selector:
query: 'true'
preserveApiResponseCaseStyle: 'true'
port:
entity:
mappings:
identifier: .name
title: .name | split("/") | last
```

When `preserveApiResponseCaseStyle` is not set or set to `false` (default behavior), all property names will converted to snake_case format regardless of their original case style in the API response.
Loading