mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

marathon/examples/Docker.json formatting error #1091

Closed nqn closed 9 years ago

nqn commented 9 years ago

The instance, cpus and mem fields are wrapped in string "'s and caused:

HTTP/1.1 400 Bad Request
Content-Length: 275
Content-Type: application/json
Server: Jetty(8.y.z-SNAPSHOT)

{
    "message": "Invalid JSON: JsResultException(errors:List((/instances,List(ValidationError(error.expected.jsnumber,WrappedArray()))), (/cpus,List(ValidationError(error.expected.jsnumber,WrappedArray()))), (/mem,List(ValidationError(error.expected.jsnumber,WrappedArray())))))"
}
ConnorDoyle commented 9 years ago

Good catch. The JSON parsing got more strict and the examples weren't updated to match.

rasputnik commented 9 years ago

Will this be backwards compatible with older Marathons?

I'm wondering when the stricter JSON requirements were enabled - we have a deployment app that we'll need to change, but it still needs to support the older syntax on some of our envs.

drexin commented 9 years ago

The old version should be fine with the strict format. The old JSON lib was more relaxed and parsed strings as numbers etc. So you should be fine with just changing it to the strict format. You should even be able to add new fields like 'upgradeStrategy' that only Marathon >= 0.7.0 uses, because they will simply be ignored by older versions.

On 24.01.2015, at 10:43, Dick Davies notifications@github.com wrote:

Will this be backwards compatible with older Marathons?

I'm wondering when the stricter JSON requirements were enabled - we have a deployment app that we'll need to change, but it still needs to support the older syntax on some of our envs.

— Reply to this email directly or view it on GitHub.

rasputnik commented 9 years ago

great, thanks.