doc: fix incorrect example of `@statusCode`
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.@statusCodein the reference and documentation.
@microsoft-github-policy-service agree
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.
/azp run typespec - pr tools
Azure Pipelines successfully started running 1 pipeline(s).
/azp run typespec - pr tools
Azure Pipelines successfully started running 1 pipeline(s).
:x: There is undocummented changes. Run chronus add to add a changeset or click here.
The following packages have changes but are not documented.
- :x:
@typespec/http