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 5 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., snake_case). By default, the GCP integration will convert these properties to camelCase. However, you can preserve the original API response case style for the following APIs:

phalbert marked this conversation as resolved.
Show resolved Hide resolved
- 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 depend on the original case style from the API response.

#### How to Enable Case Style Preservation

To preserve the case style, 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 be converted to camelCase format regardless of their original case style in the API response.
phalbert marked this conversation as resolved.
Show resolved Hide resolved
Loading