swagger-api / swagger-api/swagger-ui
Query parameter content parsing error: TypeError: Cannot read properties of undefined (reading 'collectionFormat')
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A
- OS: Windows 10 x64
- Browser: Chrome
- Version: Version 109.0.5414.74 (Official Build) (64-bit)
- Method of installation: -
- Swagger-UI version: web
- OpenAPI version: OpenAPI 3.0.3
Content & configuration
Open https://editor.swagger.io/
To reproduce...
- Paste relevant spec (attached below)
- Open user agent dev tools
- Expand the only endpoint (POST: /store/order)
- Try it out leaving input untouched
- Click Execute button
- Inspect user agent console
Expected behavior
Request should be sent without console errors
Screenshots

Additional context or thoughts
This does not happen when an example is provided in conjunction with the schema object, for instance:
content:
application/json:
schema:
oneOf:
- type: integer
format: int64
- type: string
- type: object
example: ''
I found no mentions whether example for current case is required or not in dedicated documentation section: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object-examples
open-api.yaml
openapi: 3.0.0
info:
version: 0.0.1
title: Swagger Petstore
paths:
/store/order:
parameters:
- name: storeFilter
description: Named storeFilter
required: false
in: query
content:
application/json:
schema:
oneOf:
- type: integer
format: int64
- type: string
- type: object
post:
summary: Petstore page
responses:
'200':
description: Petstore page
content:
application/json:
schema: {}
tags:
- store
tags:
- name: store
description: Access to Petstore orders
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied OpenAPI 3.0.0 specification in Swagger UI at editor.swagger.io, expand POST /store/order, and reproduce the error by executing the untouched query parameter. Trace the query parameter content parsing that reads collectionFormat; done means the request is sent without a console TypeError, including when the schema uses oneOf without an example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100