sul-dlss-deprecated / taco

Apache License 2.0
10 stars 7 forks source link

currentVersion should not be acceptable on deposit #347

Closed jcoyne closed 6 years ago

jcoyne commented 6 years ago
  1. We are passing currentVersion: true: https://github.com/sul-dlss-labs/taco/blob/master/examples/create-bs646cd8717.json#L5
  2. We are expecting that to be excluded: https://github.com/sul-dlss-labs/taco/blob/master/maps/DepositCollection.json#L7
  3. The test is saying that it's successful when it uses the example from step 1. I'd expect a 422. https://github.com/sul-dlss-labs/taco/blob/master/test/integration_test.go#L42-L56

It seems like the json schema validator isn't working, or our schema is wrong. Here's a reduced test case:

 jv maps/DepositCollection.json examples/create-bs646cd8717.json
jcoyne commented 6 years ago

This seems to work:

  "not": {
    "anyOf": [
      { "required": ["id"] },
      { "required": ["version"] },
      { "required": ["currentVersion"] }
    ]
  },
aaron-collier commented 6 years ago

Hmmm.. @jcoyne I'm seeing the same problem here, but your fix above isn't working when I put that into DepositDRO.json...

jcoyne commented 6 years ago

@aaron-collier you need to regenerate validators/maps.go. This should be fixed by https://github.com/sul-dlss-labs/taco/pull/357