Skip to content

Fix "attributes" typing for Node and Web SDKs #1037

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

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

ChiragAgg5k
Copy link
Member

What does this PR do?

In our swagger specs, we have defined the typings for an attribute to be attributeBoolean, attributeInteger and so on... but in SDK generator although we have the typings defined, we default attribute's typing to an array of strings instead of using the defined typings.

This PR adds check if typings exist in "anyOf" field of the spec, and use those as a union.

Test Plan

Before:

attribute: string[]

After:

attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString)[];

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ChiragAgg5k ChiragAgg5k requested a review from loks0n February 19, 2025 11:02
@christyjacob4 christyjacob4 merged commit 490d525 into master Feb 20, 2025
35 checks passed
@christyjacob4 christyjacob4 deleted the pla-2407 branch February 20, 2025 11:00
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.

3 participants