Skip to content

[Bug]: Loss array.items.type when with xml #6238

Open
@albertxavier100

Description

@albertxavier100

Describe the bug

Playground

The arr.items has no property type: string.

Reproduction

Add to playgound:

import "@typespec/http";
import "@typespec/xml";

using TypeSpec.Http;
using TypeSpec.Xml;
@service
namespace Foo;

@name("A_xml")
scalar A extends string;

@name("B_xml")
scalar B extends A;

scalar AA extends string;
scalar BB extends AA;


model Book {
  arr: B[];
  arr2: A[];
  arr3: BB[];
}

Outupt:

openapi: 3.1.0
info:
  title: (title)
  version: 0.0.0
tags: []
paths: {}
components:
  schemas:
    A:
      type: string
      xml:
        name: A_xml
    AA:
      type: string
    B:
      type: string
      xml:
        name: B_xml
    BB:
      type: string
    Book:
      type: object
      required:
        - arr
        - arr2
        - arr3
      properties:
        arr:
          type: array
          items:
            # ---> no type, unexpected
            xml:
              name: B_xml
          xml:
            wrapped: true
        arr2:
          type: array
          items:
            type: string # ---> expected
            xml:
              name: A_xml
          xml:
            wrapped: true
        arr3:
          type: array
          items:
            xml:
              name: BB
          xml:
            wrapped: true

Checklist

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingemitter:openapi3Issues for @typespec/openapi3 emitter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions