> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/tutorials/resourcetype-and-resourcediscriminator.md).

# resourceType and resourceDiscriminator

Starting with Collibra version 2024.10 we deprecated the `resourceType` field that is part of `Resource` and `ResourceReference` objects and their accessor methods, in favor of `resourceDiscriminator`.

Both fields have the same logical value but different data types:

* `resourceType`:
  * Returns an `enum` value.
  * Returns `BaseDataType` for traits and any newly added resource types.
* `resourceDiscriminator`:
  * Returns a `string` value.
  * Returns `Trait` for traits.

{% hint style="info" %}
As of Collibra 2024.11, Asset Type Groups (referred to as traits at the API level) are a notable exception: `resourceType` returns `BaseDataType` while `resourceDiscriminator` returns `Trait`.
{% endhint %}

## Backward compatibility

The introduction of the `resourceDiscriminator` field is necessary to ensure backward compatibility while we add new resource types as part of the evolution of the platform. Adding new values to an `enum` list is not considered backward compatible as it poses challenges to existing integrations that must regenerate their client libraries or fail to recognize the newly added values.

The deprecation of the `resourceType` field means your current applications continue to work without the need to replace the deprecated field with the new field until you are ready to do so.

{% hint style="info" %}
Some APIs may still expect `resourceType` as an input field without having an alternative available yet. Once the updates are complete, you should also update your integrations to use `resourceDiscriminator`.
{% endhint %}

## How to switch to `resourceDiscriminator`

### As a type indicator

For resources, `resourceDiscriminator` replaces `resourceType` in two ways:

* For polymorphic resources (such as attributes, which can be `StringAttribute`, `BooleanAttribute`, and so on), the discriminator is provided as a property of the object.
* For `ResourceReference` objects, which specify both an identifier and a type, the discriminator is always provided, replacing `resourceType`.

In most cases, the discriminator value is the same string as the name of the corresponding `ResourceType` enum value. For example, if `resourceType` is `Community`, the discriminator value is `"Community"`.

### As an input argument

When `resourceType` is required as an argument to a method or as a property of a request body, you can use `resourceDiscriminator` instead and pass the value as a string.

{% hint style="info" %}
Not all APIs have been updated to accept `resourceDiscriminator` as input yet. When an API does not yet have an alternative, continue to use `resourceType`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.collibra.com/tutorials/resourcetype-and-resourcediscriminator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
