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

Merged
merged 6 commits into from
Jun 3, 2024
Merged

doc: fix incorrect example of @statusCode #3230

merged 6 commits into from
Jun 3, 2024

Conversation

mochi-yu
Copy link
Contributor

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
Contributor 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
Contributor 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
@timotheeguerin
Copy link
Member

/azp run typespec - pr tools

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/http
Show changes

@timotheeguerin timotheeguerin added this pull request to the merge queue Jun 3, 2024
Merged via the queue into microsoft:main with commit 26e44b2 Jun 3, 2024
17 checks passed
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.

5 participants