-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Unexpected reference depth #1348
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Issue
Error occurs when $ref refers to a property of another object.
This feature can be useful because it allows you to edit the properties of an object in one place (especially when using different models for requests).
Example
openapi: 3.0.3
info:
title: test-service
version: 1.0.0
paths:
/samples:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateSample"
responses:
201:
description: ".."
content:
application/json:
schema:
$ref: "#/components/schemas/Sample"
components:
schemas:
Sample:
type: object
properties:
id:
type: string
format: uuid
field:
type: string
# more properties here
CreateSample:
type: object
properties:
field:
$ref: "#/components/schemas/Sample/properties/field"
Output
Error generating code: error generating type definitions: error generating Go types for component schemas: error converting Schema CreateSample to Go type: error generating Go schema for property 'field': error turning reference (#/components/schemas/Sample/properties/field) into a Go type: unexpected reference depth: 6 for ref: #/components/schemas/Sample/properties/field local: true
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request