Skip to content

Fix spector mess#6565

Merged
timotheeguerin merged 21 commits intomicrosoft:mainfrom
timotheeguerin:cleanup-spector-mess
Mar 21, 2025
Merged

Fix spector mess#6565
timotheeguerin merged 21 commits intomicrosoft:mainfrom
timotheeguerin:cleanup-spector-mess

Conversation

@timotheeguerin
Copy link
Copy Markdown
Member

@timotheeguerin timotheeguerin commented Mar 20, 2025

  1. Get rid of axios and form-data and use fetch (had to change 2 bad test getModel and headModel which passed data in the body to pass it in query instead in visibility spec)
  2. Update all spec to use the same way to define request and response body with better type support
  3. Pretty sure the validation wasn't working correctly before, caught some issues
  4. Reuse the validation error and print them better inline to see what was not send/received correctly
  5. Remove legacy mock api interface
    Disabled the nextLink server test response check as we ened a better way to define that. Thinking something like vitest
response {
  nextLink: expect.toEndWith(...)
} 

Improvement to the output

image

errors

image

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2025

All changed packages have been documented.

  • @typespec/http-specs
  • @typespec/spec-api
  • @typespec/spector
Show changes

@typespec/http-specs - fix ✏️

Fix specs to handle body correctly with new spector change

@typespec/spector - feature ✏️

Make handling of request body and response body consistent

@typespec/spec-api - feature ✏️

Make handling of request body and response body consistent

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Mar 21, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Comment thread packages/spector/src/actions/server-test.ts
Comment thread packages/spector/src/actions/server-test.ts
Comment thread packages/spector/src/actions/server-test.ts Outdated
Comment thread packages/http-specs/specs/type/model/visibility/main.tsp
Comment thread packages/spec-api/src/types.ts Outdated
Comment thread packages/spector/src/actions/helper.ts Outdated
Comment thread packages/spector/src/app/app.ts Outdated
Copy link
Copy Markdown
Member

@chrisradek chrisradek left a comment

Choose a reason for hiding this comment

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

Overall looks like an improvement to me!

@timotheeguerin timotheeguerin added this pull request to the merge queue Mar 21, 2025
Merged via the queue into microsoft:main with commit 7f27f15 Mar 21, 2025
22 checks passed
@timotheeguerin timotheeguerin deleted the cleanup-spector-mess branch March 21, 2025 18: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.

5 participants