Skip to content

OOM trying to generate go from AsyncAPI schema #41

@DerekStrickland

Description

@DerekStrickland

I ran into this error using json-cli - but the error points me to this repository.

To reproduce, run the following

json-cli gen-go https://raw.githubusercontent.com/asyncapi/bindings/master/http/json_schemas/operation.json

And you should see

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 266240 bytes) in phar:///usr/local/go/bin/json-cli/vendor/swaggest/go-code-builder/src/GoCodeBuilder.php on line 61

I'm trying to generate an HTTP binding that I can contribute to your go-asyncapi project. I've tried upping the memory limit all the way to 2GB and it still fails. I'm trying to find a fix myself, but I have never even set up a PHP development environment, so if you have any advice or fixes they would be welcome.

For what it's worth, this fails in that repo as well running make gen-2.0.0 after adding the file referenced above as http-operation-binding-object-0.1.0.json and then referencing it in asyncapi-2.0.0.json.

Changes can be seen here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions