TreeGateway / tree-gateway

This is a full featured and free API Gateway
http://treegateway.com
MIT License
190 stars 42 forks source link

Error starting TreeGateway with gateway.disableApiIdValidation flag #162

Closed igorbrites closed 5 years ago

igorbrites commented 6 years ago

I'm trying to use my own generated IDs (using bash's uuidgen) with my APIs, but TreeGateway tells me to use the flag gateway.disableApiIdValidation to disable the validation. I'm doing this to version my configurations, but I don't want to add the API to get the ID. But when I try to use it, TreeGateway does not start and shows me the message Error starting gateway: Cannot read property 'http' of undefined. I'm using version 3.1.5 and the following configuration:

rootPath: "/opt/tree-gateway"
gateway:
    disableApiIdValidation: true
database:
    redis:
        standalone:
            host: "my.redis.endpoint"
            port: 6379
thiagobustamante commented 6 years ago

I reproduced your problem here. There is a problem in the validation of this configuration file. There is a section gateway.protocol that is required but our validation is not reporting it. I am working to fix it, but, to make your configuration work now, just change your configuration file to something like:

rootPath: "/opt/tree-gateway"
gateway:
    disableApiIdValidation: true
    protocol: 
        http:
            listenPort: 8000
database:
    redis:
        standalone:
            host: "my.redis.endpoint"
            port: 6379
igorbrites commented 6 years ago

Thanks @thiagobustamante, I'll try this!

I've done a workaround using the code of this Gist from @solenoid to generate valid ObjectIDs.

Thank you again!