Open
Description
Describe the bug
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
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.