Skip to content

Accept array and unknown as FinalResult #3693

@welovej

Description

@welovej

Hi team,

We have a question regarding how FinalResult is expected to be handled for array and unknown result types in typespec.

We met this in TypeSpec migration for service web (appservice) :

Swagger Link:

Unkown : corresponds to
"schema": { "type": "object" }

Array : corresponds to
"schema": { "type": "array", "items": { "$ref": "#/definitions/NetworkTrace" }

Playground

Problem:

When FinalResult is added directly, it results in an error like:

Argument of type 'xxxx' is not assignable to parameter of type '{} | void'

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    design:neededA design request has been raised that needs a proposallib:azure-coreIssues for @azure-tools/typespec-azure-core library

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions