influxdata / influxdata/influxdb

Swagger.yml: TypeError: Converting circular structure to JSON

Open
#16,519 2 comments 0 reactions 0 assignees View on GitHub
area/api kind/bug
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Ran our swagger through this and saw the following error message:

https://apitools.dev/swagger-parser/online/?url=https%3A%2F%2Fraw.githubusercontent.com%2Finfluxdata%2Finfluxdb%2Fmaster%2Fhttp%2Fswagger.yml

```
This API is valid, but it cannot be shown because it contains circular references

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'properties' -> object with constructor 'Object'
| property 'checks' -> object with constructor 'Object'
--- property 'items' closes the circle
at JSON.stringify ()
at toText (https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:291033)
at Function.editors.addResult (https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:292169)
at Function.editors.showResult (https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:291450)
at https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:295981
at Array.forEach ()
at https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:295961
```

Contributor guide

Open the contributing guide

Research direction

Open http/swagger.yml and inspect the properties.checks.items relationship reported by the Swagger Parser online URL. Confirm that the API definition no longer produces the circular-reference display error there.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.