Skip to content

12660 bugapi create one person post api request example is returning 400 in playground #12787

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

Conversation

martmull
Copy link
Contributor

Use faker to provide simple working examples for REST API create one, create many, update one and find duplicates

Eg:
image

Copy link
Contributor

github-actions bot commented Jun 23, 2025

📊 API Changes Report

REST API Changes

Summary

🔄 Changed Operations (117)

  • /apiKeys/duplicates: Modified operation
  • /attachments/duplicates: Modified operation
  • /blocklists/duplicates: Modified operation
  • /calendarChannelEventAssociations/duplicates: Modified operation
  • /calendarChannels/duplicates: Modified operation
  • /calendarEventParticipants/duplicates: Modified operation
  • /calendarEvents/duplicates: Modified operation
  • /companies/duplicates: Modified operation
  • /connectedAccounts/duplicates: Modified operation
  • /favoriteFolders/duplicates: Modified operation
  • /favorites/duplicates: Modified operation
  • /messageChannelMessageAssociations/duplicates: Modified operation
  • /messageChannels/duplicates: Modified operation
  • /messageFolders/duplicates: Modified operation
  • /messageParticipants/duplicates: Modified operation
  • /messages/duplicates: Modified operation
  • /messageThreads/duplicates: Modified operation
  • /notes/duplicates: Modified operation
  • /noteTargets/duplicates: Modified operation
  • /opportunities/duplicates: Modified operation
  • /people/duplicates: Modified operation
  • /pets/duplicates: Modified operation
  • /rockets/duplicates: Modified operation
  • /surveyResults/duplicates: Modified operation
  • /tasks/duplicates: Modified operation
  • /taskTargets/duplicates: Modified operation
  • /timelineActivities/duplicates: Modified operation
  • /viewFields/duplicates: Modified operation
  • /viewFilterGroups/duplicates: Modified operation
  • /viewFilters/duplicates: Modified operation
  • /viewGroups/duplicates: Modified operation
  • /views/duplicates: Modified operation
  • /viewSorts/duplicates: Modified operation
  • /webhooks/duplicates: Modified operation
  • /workflowAutomatedTriggers/duplicates: Modified operation
  • /workflowRuns/duplicates: Modified operation
  • /workflows/duplicates: Modified operation
  • /workflowVersions/duplicates: Modified operation
  • /workspaceMembers/duplicates: Modified operation
  • /apiKeys: Modified operation
  • /apiKeys/{id}: Modified operation
  • /attachments: Modified operation
  • /attachments/{id}: Modified operation
  • /blocklists: Modified operation
  • /blocklists/{id}: Modified operation
  • /calendarChannelEventAssociations: Modified operation
  • /calendarChannelEventAssociations/{id}: Modified operation
  • /calendarChannels: Modified operation
  • /calendarChannels/{id}: Modified operation
  • /calendarEventParticipants: Modified operation
  • /calendarEventParticipants/{id}: Modified operation
  • /calendarEvents: Modified operation
  • /calendarEvents/{id}: Modified operation
  • /companies: Modified operation
  • /companies/{id}: Modified operation
  • /connectedAccounts: Modified operation
  • /connectedAccounts/{id}: Modified operation
  • /favoriteFolders: Modified operation
  • /favoriteFolders/{id}: Modified operation
  • /favorites: Modified operation
  • /favorites/{id}: Modified operation
  • /messageChannelMessageAssociations: Modified operation
  • /messageChannelMessageAssociations/{id}: Modified operation
  • /messageChannels: Modified operation
  • /messageChannels/{id}: Modified operation
  • /messageFolders: Modified operation
  • /messageFolders/{id}: Modified operation
  • /messageParticipants: Modified operation
  • /messageParticipants/{id}: Modified operation
  • /messages: Modified operation
  • /messages/{id}: Modified operation
  • /messageThreads: Modified operation
  • /messageThreads/{id}: Modified operation
  • /notes: Modified operation
  • /notes/{id}: Modified operation
  • /noteTargets: Modified operation
  • /noteTargets/{id}: Modified operation
  • /opportunities: Modified operation
  • /opportunities/{id}: Modified operation
  • /people: Modified operation
  • /people/{id}: Modified operation
  • /pets: Modified operation
  • /pets/{id}: Modified operation
  • /rockets: Modified operation
  • /rockets/{id}: Modified operation
  • /surveyResults: Modified operation
  • /surveyResults/{id}: Modified operation
  • /tasks: Modified operation
  • /tasks/{id}: Modified operation
  • /taskTargets: Modified operation
  • /taskTargets/{id}: Modified operation
  • /timelineActivities: Modified operation
  • /timelineActivities/{id}: Modified operation
  • /viewFields: Modified operation
  • /viewFields/{id}: Modified operation
  • /viewFilterGroups: Modified operation
  • /viewFilterGroups/{id}: Modified operation
  • /viewFilters: Modified operation
  • /viewFilters/{id}: Modified operation
  • /viewGroups: Modified operation
  • /viewGroups/{id}: Modified operation
  • /views: Modified operation
  • /views/{id}: Modified operation
  • /viewSorts: Modified operation
  • /viewSorts/{id}: Modified operation
  • /webhooks: Modified operation
  • /webhooks/{id}: Modified operation
  • /workflowAutomatedTriggers: Modified operation
  • /workflowAutomatedTriggers/{id}: Modified operation
  • /workflowRuns: Modified operation
  • /workflowRuns/{id}: Modified operation
  • /workflows: Modified operation
  • /workflows/{id}: Modified operation
  • /workflowVersions: Modified operation
  • /workflowVersions/{id}: Modified operation
  • /workspaceMembers: Modified operation
  • /workspaceMembers/{id}: Modified operation

⚠️ Please review these API changes carefully before merging.

⚠️ Breaking Change Protocol

Breaking changes detected but PR title does not contain "breaking" - CI will pass but action needed.

🔄 Options:

  1. If this IS a breaking change: Add "breaking" to your PR title and add BREAKING CHANGE: to your commit message
  2. If this is NOT a breaking change: The API diff tool may have false positives - please review carefully

For breaking changes, add to commit message:

feat: add new API endpoint

BREAKING CHANGE: removed deprecated field from User schema

@martmull martmull marked this pull request as ready for review June 23, 2025 14:18
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Enhanced OpenAPI documentation with realistic example data using Faker.js for better API playground experience and testing.

  • Added new generate-random-field-value.utils.ts using Faker.js to generate realistic example data for all field types
  • Modified components.utils.ts to streamline schema generation with a simplified forUpdate parameter
  • Added example data generation for various field types (currency, emails, names, links) in OpenAPI schema components
  • Updated request-body.utils.ts to include UUID examples for the findDuplicates endpoint
  • Refactored camelToTitleCase.ts to improve code readability by reordering transformation steps

5 files reviewed, 7 comments
Edit PR Review Bot Settings | Greptile

Comment on lines 81 to 83
case FieldMetadataType.SELECT: {
return field.options[0].value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Potential runtime error if field.options is empty array. Add null check before accessing index 0.

Copy link
Contributor

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:36445

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Contributor

@prastoin prastoin left a comment

Choose a reason for hiding this comment

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

Very cool to be working on that ! Interesting !
Left few comments and nitpicks
Please let me know


case FieldMetadataType.EMAILS: {
return {
primaryEmail: faker.internet.email().toLowerCase(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: would pass a deterministic twenty domain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why? for a person email that would have not a lot of sense isn't it?

Copy link
Contributor

@prastoin prastoin Jun 23, 2025

Choose a reason for hiding this comment

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

I always tend to generate "controlled" email addresses for the sake of local testing, just in case :p

@prastoin
Copy link
Contributor

Very cool and smooth to test thing quickly from the REST API now
Well done

@prastoin
Copy link
Contributor

prastoin commented Jun 23, 2025

@FelixMalfait if you could still review the diff checker bot stacktrace which is unless I'm mistaken a false positive as we've massively updated the open api schema.

Tho I'm still wondering why examples would raise breaking changes, @martmull maybe changes made to the computeSchemaComponent signature introduced some signature regressions 🤔

We should dig deeper if possible to wait before merging

@martmull martmull merged commit 6e4dc16 into main Jun 23, 2025
41 of 42 checks passed
@martmull martmull deleted the 12660-bugapi-create-one-person-post-api-request-example-is-returning-400-in-playground branch June 23, 2025 16:24
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(api): Create One person post API request example is returning 400 in playground
2 participants