Replies: 1 comment
-
Mistake on my end. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am new to Loopback and started a new project today.
My use-case is that I want to provide a REST API scraping a specific webpage so it's easier to work with.
I now have a Controller working as expected and it returns a Model. This Model uses another Model that uses another Model as well. I've turned everything into models so the generated openapi docs would be clean and easier to read/process.
Here is a simplification of what I have:
Trimmed-down code showing my 3 models and my controller
To summarize: my controller returns a Model
AlCharacter
that contains a ModelItemSlots
that contains twoAlCharacterItem
. In the real code, the models are bigger, with enums containing lots of values.As you can see in the controller, I use
schema: getModelSchemaRef(AlCharacter)
so the schema is generated based on my Models. It works fine for the top level but the definitions ofItemSlots
andAlCharacterItem
are not provided which results in an error.Here is the generated json:
As you can see, there is a ref to
ItemSlots
but it's not defined.How am I supposed to fix this situation?
Beta Was this translation helpful? Give feedback.
All reactions