[Swagger Linter Migration] ParametersSchemaAsTypeObject (origin) - #5350
Draft
Yuchao Yan (msyyc) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the migrated ParametersSchemaAsTypeObject lint rule to mirror AutoRest request-body schema emission across additional TypeSpec shapes.
Changes:
- Adds scalar encoding, enum, file, multipart, and model-property handling.
- Adds six fixture groups and emission-matrix documentation.
- Strengthens LintDiff migration guidance for emission-dependent rules.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/skills/develop-lintdiff-rule/SKILL.md |
Adds semantic completeness guidance. |
packages/typespec-lintdiff/src/rules/parameters-schema-as-type-object.ts |
Expands emitted-schema classification. |
packages/typespec-lintdiff/test/fixtures/ParametersSchemaAsTypeObject/rule.md |
Documents the emission matrix. |
packages/typespec-lintdiff/test/fixtures/ParametersSchemaAsTypeObject/migration.md |
Records migration evidence and boundaries. |
.../unbased-scalar-body/main.tsp |
Defines the unbased-scalar case. |
.../unbased-scalar-body/output.json |
Captures emitted OpenAPI. |
.../unbased-scalar-body/expect.json |
Declares expected compliance. |
.../unbased-scalar-body/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../unbased-scalar-body/validator-diagnostics.json |
Captures validator results. |
.../multipart-body/main.tsp |
Defines the multipart case. |
.../multipart-body/output.json |
Captures emitted OpenAPI. |
.../multipart-body/expect.json |
Declares expected compliance. |
.../multipart-body/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../multipart-body/validator-diagnostics.json |
Captures validator results. |
.../explicit-schema-type-bodies/main.tsp |
Defines explicit non-object cases. |
.../explicit-schema-type-bodies/output.json |
Captures emitted OpenAPI. |
.../explicit-schema-type-bodies/expect.json |
Declares expected violations. |
.../explicit-schema-type-bodies/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../explicit-schema-type-bodies/validator-diagnostics.json |
Captures validator results. |
.../encoded-model-property-body/main.tsp |
Defines referenced-property encoding cases. |
.../encoded-model-property-body/output.json |
Captures emitted OpenAPI. |
.../encoded-model-property-body/expect.json |
Declares expected compliance. |
.../encoded-model-property-body/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../encoded-model-property-body/validator-diagnostics.json |
Captures validator results. |
.../empty-enum-body/main.tsp |
Defines the empty-enum case. |
.../empty-enum-body/output.json |
Captures emitted OpenAPI. |
.../empty-enum-body/expect.json |
Declares expected compliance. |
.../empty-enum-body/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../empty-enum-body/validator-diagnostics.json |
Captures validator results. |
.../empty-encoded-scalar-body/main.tsp |
Defines schema-less encoding cases. |
.../empty-encoded-scalar-body/output.json |
Captures emitted OpenAPI. |
.../empty-encoded-scalar-body/expect.json |
Declares expected compliance. |
.../empty-encoded-scalar-body/tsp-diagnostics.json |
Captures TypeSpec diagnostics. |
.../empty-encoded-scalar-body/validator-diagnostics.json |
Captures validator results. |
Suppressed comments (1)
packages/typespec-lintdiff/test/fixtures/ParametersSchemaAsTypeObject/rule.md:54
- The expected result here should be “follow the resolved schema,” not unconditional pass. The listed fixture only proves untyped-scalar and object-union references; add a referenced standard-based scalar control that violates, otherwise the matrix's claimed coverage omits this reachable branch.
| encoded model property backed by a referenced scalar or named union, including nullable wrappers | `$ref` plus sibling encoded type; validator resolves the reference | pass | `encoded-model-property-body` |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+197
to
+203
| if (mergedFormat && isSupportedAutorestFormat(mergedFormat)) { | ||
| schema = { | ||
| hasType: encodedSchema.hasType, | ||
| format: mergedFormat, | ||
| }; | ||
| } | ||
| } |
Comment on lines
+28
to
+29
| - an encoded model-property body backed by a referenced scalar should pass because validator | ||
| reference resolution hides the sibling encoded type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParametersSchemaAsTypeObjectfollow AutoRest request-body emission across body kinds and all reachable TypeSpec type familiesdevelop-lintdiff-ruleskill with an emission-dependent semantic completeness gateValidation
f6b53f105b95da05276530a0754a1c71b4f16397: 462/468 projects compiled; 9 Swagger projects, 9 TypeSpec projects, 9 overlap, no one-sided projects; 18 Swagger diagnostics and 19 raw/18 deduplicated TypeSpec diagnosticsKnown boundary
External schemas supplied through AutoRest
@useRefare opaque to the TypeSpec semantic program. The equivalence claim excludes pathological primitive external references; diagnosing every@useRefmodel would reject intended object-schema references.