Skip to content

feat: expose defaults#178

Merged
mikewuu merged 13 commits intomainfrom
add-defaults
Apr 19, 2025
Merged

feat: expose defaults#178
mikewuu merged 13 commits intomainfrom
add-defaults

Conversation

@mikewuu
Copy link
Copy Markdown
Contributor

@mikewuu mikewuu commented Apr 17, 2025

Required for https://linear.app/seam/issue/CX-284/show-default-values-for-all-parameters-in-seam-connect, this PR parses out the default from the openapi schema.

Notable things

Went with any type here for the default. Checked the openapi type, and it that's what it was there, so I figured it might be ok here too. Maybe we can update the ts type with a generic to say the default should be the same time as the value?

@mikewuu mikewuu requested a review from a team as a code owner April 17, 2025 05:27
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blueprint ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 2:50pm

Comment thread src/lib/blueprint.ts Outdated
undocumentedMessage: string
isDraft: boolean
draftMessage: string
default?: any
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per you comment, this can be moved off of the base type and defined per specific type to match the parameter type.

Suggested change
default?: any

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh ya that works lol

  • Moved to specific types in a6d8053 so consumers get proper types
  • Extended baseParam with any default a6d8053 because parsedProp.default is any anyway.

@mikewuu mikewuu changed the title feat: show defaults in blueprint feat: expose defaults in blueprint Apr 17, 2025
@mikewuu mikewuu changed the title feat: expose defaults in blueprint feat: expose defaults Apr 17, 2025
@mikewuu mikewuu requested a review from razor-x April 17, 2025 12:34
Copy link
Copy Markdown
Member

@razor-x razor-x left a comment

Choose a reason for hiding this comment

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

Since null is a valid default value for non-list parameters, let's add hasDefault to the BaseParameter

Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
Comment thread src/lib/blueprint.ts Outdated
mikewuu and others added 4 commits April 18, 2025 08:22
Co-authored-by: Evan Sosenko <evan@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
mikewuu and others added 4 commits April 18, 2025 23:47
Co-authored-by: Evan Sosenko <evan@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
@mikewuu mikewuu merged commit 74bea73 into main Apr 19, 2025
21 checks passed
@mikewuu mikewuu deleted the add-defaults branch April 19, 2025 01:54
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