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

doc: fix incorrect example of @statusCode #3230

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

Conversation

mochi-yu
Copy link

Issue Description

There is a example of TypeSpec.http.@statusCode here. However, the property name is missing in this example. Due to this, the code did not work as expected.

op read(): {@statusCode: 200, @body pet: Pet}
op create(): {@statusCode: 201 | 202}

Instead, specifying the property name as follows made it work correctly:

op read(): {
  @statusCode _: 200;
  @body pet: Widget;
};
op create(): {
  @statusCode _: 201 | 202;
};

Fix Description

  • Corrected examples of TypeSpec.http.@statusCode in the reference and documentation.

@mochi-yu
Copy link
Author

@microsoft-github-policy-service agree

@mochi-yu mochi-yu marked this pull request as ready for review April 24, 2024 17:07
@mochi-yu
Copy link
Author

Dear Maintainer,

Thanks for this useful tool!
I was using TypeSpec and found this incorrect example. I wanted to contribute to this tool, so I committed this fix and created a pull request.
However, I do not have enough experience contributing to OSS projects. If I missed something, I would like you to fix it or support me.

@timotheeguerin
Copy link
Member

/azp run typespec - pr tools

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bterlson bterlson added docs Improvements or additions to documentation lib:http labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation lib:http
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants