mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 09:57:10 +00:00
Add tests for inline objects (#1331)
I think these tests cover all the problems with rust-server and inline objects I know about. This should show us when we've fixed the problem. Also fixes a CI failure.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
description: "This spec is for testing rust-server-specific things"
|
||||
version: 2.0.0
|
||||
version: 2.3.4
|
||||
title: rust-server-test
|
||||
schemes:
|
||||
- http
|
||||
@@ -12,6 +12,12 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
put:
|
||||
parameters:
|
||||
- $ref: '#/parameters/nested_response'
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
/html:
|
||||
post:
|
||||
summary: Test HTML handling
|
||||
@@ -28,6 +34,20 @@ paths:
|
||||
description: Success
|
||||
schema:
|
||||
type: string
|
||||
parameters:
|
||||
nested_response:
|
||||
name: nested_response
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
# Erroneously ends up as `Option<models::InlineObject>`
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
required:
|
||||
- id
|
||||
definitions:
|
||||
additionalPropertiesObject:
|
||||
description: An additionalPropertiesObject
|
||||
@@ -46,3 +66,31 @@ definitions:
|
||||
x-nullable: true
|
||||
required:
|
||||
- RequiredNullableThing
|
||||
ObjectOfObjects:
|
||||
description: An object of objects
|
||||
type: object
|
||||
properties:
|
||||
inner:
|
||||
type: object
|
||||
required:
|
||||
- required_thing
|
||||
properties:
|
||||
required_thing:
|
||||
type: string
|
||||
optional_thing:
|
||||
type: integer
|
||||
# Currently broken - see https://github.com/OpenAPITools/openapi-generator/issues/8
|
||||
# ArrayOfObjects:
|
||||
# description: An array of objects
|
||||
# type: array
|
||||
# items:
|
||||
# properties:
|
||||
# filename:
|
||||
# description: A non-required property
|
||||
# type: string
|
||||
# contents:
|
||||
# description: A required property
|
||||
# type: string
|
||||
# required:
|
||||
# - contents
|
||||
# type: object
|
||||
|
||||
Reference in New Issue
Block a user