Azure / Azure/typespec-azure

Linting rule against non model response

Open
#912 0 comments 0 reactions 0 assignees View on GitHub
feature lib:azure-core
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

Copied from https://github.com/Azure/typespec-azure-pr/issues/2600

```
op world(): MyEnum;
```
returns a string. It should be disallowed.

General request is: If the return type is not a model, then it should be disallowed.

> I'd be fine with a rule that flags a non-model return type for application/json.
> from @mikekistler

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Start by locating the existing lint-rule entry points and tests for operation return types, then determine how application/json responses are represented. Done means the rule flags operations returning a non-model type, such as MyEnum, while the expected model-returning cases remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.