danielgtaylor / danielgtaylor/apisprout

apisprout is rejecting perfecly valid json references

Open
#40 5 comments 1 reaction 0 assignees View on GitHub
bug upstream
Dominant language
Go
Stars
719
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I have in my main spec document something like this:

```
components:
ListOfWidgets:
$ref: 'parts/widget/model.yaml#/ListOfWidgets`
Widget:
$ref: 'parts/widget/model.yaml#/Widget`
```

And `parts/widget/model.yaml` looks something like this:

```
ListOfWidgets:
type: array
items:
$ref: '#/Widget'

Widget:
properties:
id:
type: string
description:
type: string
```

apisprout rejects this because:

```
2019/05/31 14:37:49 expected prefix '#/components/schemas/' in URI '#/ListOfWidgets'
```

That seems unreasonable. apisprout should not be enforcing restrictions on the organization of documents. These are not schemas because the path includes `#/components/schemas`; they are schemas because they are included by reference in the `schemas` section of the specification.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.