---
swagger: '2.0'
info:
version: 0.0.0
title: Simple API
paths:
/:
get:
responses:
200:
description: OK
definitions:
Thing:
properties:
parent_thing:
allOf:
- $ref: '#/definitions/Thing'
description: parent of this thing
Here is the minimal example. If I write this in swagger-editor, it shows that parent_thing is of type undefined
: https://i.imgur.com/OGHlKxg.png
How do I fix that? I want Thing
to have a reference to other Thing
s.
Self-Reference. In the context of language, self-reference is used to denote a statement that refers to itself or its own referent. The most famous example of a self-referential sentence is the liar sentence : “This sentence is not true.” Self-reference is often used in a broader context as well.
Self-reference occurs in natural or formal languages when a sentence, idea or formula refers to itself. The reference may be expressed either directly—through some intermediate sentence or formula—or by means of some encoding.
The reference may be expressed either directly—through some intermediate sentence or formula—or by means of some encoding. In philosophy, it also refers to the ability of a subject to speak of or refer to itself, that is, to have the kind of thought expressed by the first person nominative singular pronoun "I" in English.
What is Self Reference Criterion? Self reference criterion is concept specially in international marketing, where all marketers have some unconscious reference towards own culture, religion and values.
You can have self-references, but you probably don't use the allOf
construct:
definitions:
Thing:
properties:
parent_thing:
$ref: '#/definitions/Thing'
The above is valid, if the swagger-editor is not showing it correctly, that is a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With