Skip to content

fix: add missing items field to UserSchemaAttribute#489

Open
sagar-okta wants to merge 1 commit intomasterfrom
sv-fix-OKTA-1145113
Open

fix: add missing items field to UserSchemaAttribute#489
sagar-okta wants to merge 1 commit intomasterfrom
sv-fix-OKTA-1145113

Conversation

@sagar-okta
Copy link
Copy Markdown
Contributor

PR Checklist

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Adding Tests
  • Build related changes
  • CI related changes
  • Documentation changes
  • Other...

What is the current behavior?

Issue Number: #480

When calling schemaApi.updateApplicationUserProfile with a custom attribute of type: 'array', the SDK strips the items field from the request body. The Okta API then rejects the request with:

Items not present for array property: <prop_name>

Root cause: The items property was accidentally dropped from the UserSchemaAttribute schema when the OpenAPI spec was updated from v4.0.0 to v5.x. The UserSchemaAttributeItems class and the GroupSchemaAttribute.items field were both retained, but UserSchemaAttribute.items was not regenerated.

What is the new behavior?

  • UserSchemaAttribute now includes the items field typed as UserSchemaAttributeItems, consistent with GroupSchemaAttribute.
  • Callers can pass items: { type: 'string' } (or any valid UserSchemaAttributeItems value) when setting type: 'array' on a custom attribute.
  • No behaviour change for attributes that do not use type: 'array'.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Files changed:

  • oas-spec/management.yaml — added items field ($ref: UserSchemaAttributeItems, nullable: true) to UserSchemaAttribute schema
  • src/generated/models/UserSchemaAttribute.js — added items entry to attributeTypeMap
  • src/types/generated/models/UserSchemaAttribute.d.ts — added UserSchemaAttributeItems import and items property declaration

@sagar-okta sagar-okta self-assigned this Apr 21, 2026
aniket-okta

This comment was marked as spam.

Copy link
Copy Markdown

@aniket-okta aniket-okta left a comment

Choose a reason for hiding this comment

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

Security audit, type check, unit + jest tests (114/114), and live API smoke test passed. The items field addition is correct and exactly mirrors the GroupSchemaAttribute pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants