restish icon indicating copy to clipboard operation
restish copied to clipboard

Process crashes for large schema

Open sunnyagain opened this issue 1 year ago • 4 comments

I'm trying to run cli with bitbucket OpenAPI schema from

https://dac-static.atlassian.com/cloud/bitbucket/swagger.v3.json?_v=2.300.114-0.1324.0

This is large file even browser takes a while to format this schema in readable json.

When using this with restish it crashes with following error.

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc092c80318 stack=[0xc092c80000, 0xc0b2c80000]
fatal error: stack overflow

I have tried reducing this schema to only specific to my required tags with following but still it is crashing with similar error. So I'm not sure what is wrong here

jq '.paths|= with_entries( select (.value |to_entries[0] |select( .value.tags? |any(.=="Pipelines"))))' schema.json > ~/mini-schema.json

My env

go version go1.24.5 darwin/amd64
restish version dev-2025-07-24-17:33

Thanks in advance

sunnyagain avatar Jul 24 '25 15:07 sunnyagain

That link doesn't load, can you attach the mini-schema you mention using?

RAdamMartin avatar Jul 27 '25 22:07 RAdamMartin

Source schema link is available on this page https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication

You can also find files dumped at https://gist.github.com/sunnyagain/51b3a15715029f42473e0c34a24f06f2/revisions

Thank you!

mini-schema.json

sunnyagain avatar Jul 28 '25 05:07 sunnyagain

@sunnyagain I think i may have found the issue, could you give my fix a try?

terev avatar Aug 04 '25 22:08 terev

@terev Thank you for your fix.

I have tried this patch and can confirm it works.

I hope this gets merged.

https://asciinema.org/a/732029

Thanks again!

sunnyagain avatar Aug 06 '25 13:08 sunnyagain