Self-referencing object type with dots in Schema name results in build errors
See original GitHub issueI tweaked a simple OpenAPI 3.0 spec (file attached) to rename “Pet” to “One.Two.Pet” and have that object contain a reference to itself:
components:
schemas:
One.Two.Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
pets:
type: array
items:
$ref: "#/components/schemas/One.Two.Pet"
This results in this TS code (entire file):
/* tslint:disable */
export interface Pet {
id: number;
name: string;
pets?: Array<OneTwoPet>;
tag?: string;
}
the “OneTwoPet” does not exist. pets-with-pets.txt
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
JSON.Net Self referencing loop detected - Stack Overflow
The code results in the following error: Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'CyberUser' with type 'DAL.
Read more >[graphql] API generation fails if schema has self-referencing ...
API generation fails is schema has self-referencing types. To Reproduce. Use a schema with a self referencing type: e.g.. export default { name...
Read more >Invalid template errors - Azure Resource Manager
Describes how to resolve invalid template errors when deploying Bicep files or Azure Resource Manager templates (ARM templates).
Read more >Memory for Details with Self-Referencing - PMC - NCBI
Experiment 1 assessed whether the effects of self-referencing operate only at the item, or general, level or also enhance memory for specific visual...
Read more >Nesting Schemas — marshmallow 3.19.0 documentation
Schemas can be nested to represent relationships between objects (e.g. ... from marshmallow import Schema, fields class UserSchema(Schema): name = fields.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, this time it is a bug indeed 😉 Thanks for the PR. Will merge and tweak if needed.
I’ll open another issue