$ref not working

This is how I have the reference for “accounts” under “app.user”.

And this is the code it produces:

app.user:
  title: app.user
  type: object
  properties:
    id:
      type: integer
    email:
      type: string
    token:
      type: string
    accounts:
      type: array
      items:
        title: app.finance-account
        type: object

As you can see instead of the $ref, it uses the entire object.

I expected it would look like this:

app.user:
  title: app.user
  type: object
  properties:
    id:
      type: integer
    email:
      type: string
    token:
      type: string
    accounts:
      type: array
      items:
        $ref: '#/components/schemas/app.finance-account'

This is expected, and is the current strategy that Studio uses for resolving JSON Schema references. We are working on a ‘bundling’ method that would do what you propose. You can track the progress on this functionality by following the Github issue here:

1 Like