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

http-specs, test case on status code range #5577

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

weidongxu-microsoft
Copy link
Contributor

Currently I only added case for the range in error response.

Range can also happen on success response (e.g. 200-299).

Comment on lines +10 to +11
@scenarioService("/response/status-code-range")
namespace Response.StatusCodeRange;
Copy link
Contributor Author

@weidongxu-microsoft weidongxu-microsoft Jan 13, 2025

Choose a reason for hiding this comment

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

Let me know if anyone has better opinion on folder/namespace.

I thought about "payload" folder, but this is not exactly payload.

""")
@route("/error-response")
@get
op errorResponse(): 204 | ErrorInRange | DefaultError;
Copy link
Contributor Author

@weidongxu-microsoft weidongxu-microsoft Jan 13, 2025

Choose a reason for hiding this comment

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

I can remove DefaultError, as this one would not affect the code in range (494-499).

Having it there serves another scenario that different status code result into different error model in client.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 13, 2025

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - feature ✏️

Add test case on status code range

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

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.

2 participants