question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self-referencing object type with dots in Schema name results in build errors

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
luisfpgcommented, Mar 24, 2020

Third time I’m filing an issue and it might actually be a real issue this time! 😉

Well, this time it is a bug indeed 😉 Thanks for the PR. Will merge and tweak if needed.

0reactions
tommckcommented, Mar 30, 2020

I’ll open another issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found