Skip to content

chore: handle free form object using any #1090

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tiwarishubham635
Copy link
Contributor

Fixes #1076

These are preview changes for handling free form objects correctly using Record<string, any> instead of Record<string, object>.
Note: Close this PR only when the OAI generator changes are merged.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

Copy link

@@ -174,7 +174,7 @@ export class JobInstance {
/**
* The details of a job which is an object that contains an array of status grouped by `status` state. Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days.
*/
details: Record<string, object>;
details: Record<string, any>;

Choose a reason for hiding this comment

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

This should be an array, Record<string, any>[]. Please see my original comment from when the breaking change was introduced: #1076 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have mentioned there that this particular field is a list but in our specification it is written as an object. I'll convey this to my team to fix this. It is still under process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just checked with my team and I think what they want to send in this field is something of this sort:

{
   [
    {
      status: 'Submitted',
      count: 3,
      days: [ '2025-03-07', '2025-03-08', '2025-03-09' ]
    }
  ]
}

Thus it should be object and not list. Is this correct with your API call too?

Choose a reason for hiding this comment

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

The API response that I received is an array of objects. The example where you show an array nested directly inside of an object is not valid JavaScript or JSON so that would not be possible to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right, let me get this fixed with my team. Thanks!

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.

[Bug] Invalid types in last update
2 participants