4eixos / eixo-docker

Suite of Perl modules to interact with Docker
Apache License 2.0
18 stars 4 forks source link

Need to find a way to send correct data types to api (boolean, int, float, string) #1

Closed alambike closed 10 years ago

alambike commented 10 years ago

Because Go is strongly typed, we need to find a way to convert Docker::Products' attributes into correct data types, maybe with a adequated 'TO_JSON' method

Example problem: Cannot create a container with StdOut and StdErr detached, because Docker::Config corresponding attributes must be boolean

-> Entering in Method 'Eixo::Rest::Client->post' with Args (http://localhost:4243/containers/create,GET_DATA,HASH(0x155aa80),POST_DATA,Eixo::Docker::Config=HASH(0x155a9f0))
not ok 4 - New container created$VAR1 = bless( {
#                  'reason' => 'ERROR_CODE',
#                  'args' => [
#                              500,
#                              'create: ExportEnv json: cannot unmarshal number into Go value of type bool'
#                            ],
#                  'error' => 'Server error',
#                  'method' => 'postContainers',
#                  'error_details' => 'Error produced in \'postContainers\' api call. Details: 500 - create: ExportEnv json: cannot unmarshal number into Go value of type bool'
#                }, 'Eixo::Docker::ContainerException' );
alambike commented 10 years ago

Seems fixed with https://github.com/alambike/eixo-docker/commit/e7b81b6d50c096ed0e855727ccad02bb3f949f62