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

fix: oneOf in sessions #339

Merged
merged 1 commit into from
Jul 11, 2023
Merged

fix: oneOf in sessions #339

merged 1 commit into from
Jul 11, 2023

Conversation

esoubiran-aneo
Copy link
Contributor

@esoubiran-aneo esoubiran-aneo commented Jul 7, 2023

Currently, the oneOf will generate this type in TS :

export interface AsObject {
  taskSummaryField: TaskSummaryField.AsObject;
  taskOptionField: TaskOptionField.AsObject;
  taskOptionGenericField?: TaskOptionGenericField.AsObject;
}

As you can see, taskSummaryField and taskOptionField are required, but taskOptionGenericField is optional. This is not what we want. We want to make each field optional.

This occurs since we use enum directly in oneOf field. We should use a message instead.

This PR do this change and fix the issue. Now, generated code is :

export interface AsObject {
  taskSummaryField?: TaskSummaryField.AsObject;
  taskOptionField?: TaskOptionField.AsObject;
  taskOptionGenericField?: TaskOptionGenericField.AsObject;
}

fix #338

@esoubiran-aneo esoubiran-aneo added the bug Something isn't working label Jul 7, 2023
@esoubiran-aneo esoubiran-aneo self-assigned this Jul 7, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
515 466 90% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 19dc7ef by action🐍

@esoubiran-aneo
Copy link
Contributor Author

I'll do others PR to fix applications and tasks.

@aneojgurhem
Copy link
Contributor

@esoubiran-aneo You need to update this one since I merged the new sort fields for listing sessions

Copy link
Contributor Author

@esoubiran-aneo esoubiran-aneo left a comment

Choose a reason for hiding this comment

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

Update name in enum to have ENUM in name.

@esoubiran-aneo
Copy link
Contributor Author

@aneojgurhem, it's fixed

@aneojgurhem aneojgurhem merged commit 1182dc8 into main Jul 11, 2023
@aneojgurhem aneojgurhem deleted the fix/one-of-sessions branch July 11, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to use message instead of enum in oneOf
3 participants