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

feat: allow namespaced component names #683

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Jan 30, 2025

OpenAPI generated by Typespec will use namespace-qualified component names in the generated OpenAPI, when types are in a different namespace from that of the OpenAPI spec.

This updates the componentNameCase rule to allow PascalCase component names with a dot.case namespace prefix.

DONE: figure out how to deal with TypeSpec materialized component names for parameters.

@cmars cmars force-pushed the feat/support-namespaced-component-names branch 2 times, most recently from e436220 to 7776b47 Compare January 30, 2025 20:26
@cmars cmars marked this pull request as ready for review January 30, 2025 20:32
@cmars cmars requested a review from a team as a code owner January 30, 2025 20:32
@cmars cmars requested a review from jgresty February 3, 2025 16:45
@cmars cmars force-pushed the feat/support-namespaced-component-names branch from 7776b47 to dfaca7c Compare February 3, 2025 16:48
OpenAPI generated by Typespec will use namespace-qualified component names in
the generated OpenAPI, when types are in a different namespace from that of the
OpenAPI spec. Additionally, components derived from model properties such as
parameters or headers use the property name as a suffix.

This updates the componentNameCase rule to allow PascalCase component names
with an optional dot.case namespace prefix and optional snake_case suffix.

Updated the sweater-comb standards documentation with this change.

DGP-50
@cmars cmars force-pushed the feat/support-namespaced-component-names branch from dfaca7c to c22f0ff Compare February 3, 2025 16:50
Copy link
Member

@jgresty jgresty left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for the clear docs

@cmars cmars merged commit e0c65ba into main Feb 3, 2025
7 checks passed
@cmars cmars deleted the feat/support-namespaced-component-names branch February 3, 2025 17:49
@snyksec
Copy link

snyksec commented Feb 3, 2025

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants