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

should we error out if there's no pagedItems inside pagedResult model #1993

Open
qiaozha opened this issue Dec 17, 2024 · 1 comment
Open

Comments

@qiaozha
Copy link
Member

qiaozha commented Dec 17, 2024

In the case, we have pagedResult, but without pagedItems to indicate the item types. Should we error out? if so, should compiler do this or should tcgc or azure linter do this?

@error
model Error {
    code: int32;
    message: string;
}

@pagedResult
model Bar {
    lists: string[];
}

// this will be ok
@route("/test")
op test(): Error | Bar;

// this will not be ok as compiler would report missing-paging-items 
@route("/test1")
@list op test1(): Error | Bar;

See this playground link

@qiaozha
Copy link
Member Author

qiaozha commented Dec 19, 2024

tcgc or azure linter should error out if there's no item type being extracted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant