Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to return partial models #9

Merged

Conversation

peldszus
Copy link

@peldszus peldszus commented Mar 6, 2018

No description provided.

@peldszus
Copy link
Author

peldszus commented Mar 6, 2018

To be taken care of after #8.

@peldszus
Copy link
Author

peldszus commented Mar 6, 2018

PS: The impact of this feature is at the moment impaired, because we cannot correctly partially validate partial models with nested ModelTypes in schematics<2.0.1. See schematics/schematics#544

* Supercell always validates the output model in the provider
  before its serialization is returned by the handler. If
  you want to return a partial model, this will result in an
  internal error (500) due to potentially missing required
  fields.
* A keyword parameter is added to the provide decorator,
  signalling that the return model validation should not
  raise validation errors for partial models, if set to true.
  The default value is False.
* It turns out, the partial validation is not correctly working in
  version of schematics<2.0.1. A test for this was added, which is
  skipped if the currently used schematics version is older. This is
  the case as long as supercell is still using the old 1.1.1 version
  of schematics.
@peldszus peldszus force-pushed the option-to-return-partial-models branch from 9e62ef2 to 9d81490 Compare March 8, 2018 16:04
@coveralls
Copy link

coveralls commented Mar 8, 2018

Coverage Status

Coverage increased (+0.05%) to 94.757% when pulling 9d81490 on peldszus:option-to-return-partial-models into c1aad05 on retresco:master.

@drotschmann drotschmann merged commit 539fdf8 into retresco:master Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants