1. 06 Dec, 2021 2 commits
  2. 26 Aug, 2021 1 commit
  3. 24 Aug, 2021 1 commit
  4. 03 Aug, 2021 1 commit
  5. 17 Jul, 2021 1 commit
  6. 16 Jul, 2021 1 commit
  7. 29 Apr, 2021 1 commit
  8. 20 Apr, 2021 2 commits
  9. 12 Mar, 2021 1 commit
  10. 19 Feb, 2021 1 commit
  11. 16 Feb, 2021 1 commit
  12. 15 Jan, 2021 3 commits
  13. 13 Jan, 2021 1 commit
  14. 09 Dec, 2020 1 commit
  15. 01 Dec, 2020 1 commit
  16. 27 Nov, 2019 3 commits
  17. 26 Nov, 2019 1 commit
    • Jérémy Bobbio (Lunar)'s avatar
      Update Debian packaging with support for Python 3 · f2afca59ed1b
      Jérémy Bobbio (Lunar) authored
      The new binary package with Python 3 support is named
      python3-cubicweb-jsonschema according to current standards.
      Python 2 package is also updated to use the proper namespace
      and a transitional package has been introduced to handle
      the migration.
      We also take this opportunity to run the tests at build time.
      Support for Python 3.8 is disabled as it is currently broken
      in Debian unstable.
  18. 07 Mar, 2019 2 commits
  19. 13 Dec, 2018 4 commits
  20. 31 Oct, 2018 1 commit
  21. 06 Jul, 2018 1 commit
    • Denis Laxalde's avatar
      Detect bad mime types upon data submission views · d2b673a15823
      Denis Laxalde authored
      Previously, we did "request.json_body" in every data submission views
      (like entity creation or update, with HTTP method being POST or PUT).
      This instruction might fail with JSONDecodeError exception if the body
      fails to JSON decode. This would result in a 500 error response. Rather
      we want to return a 40x response indicating that this is a client error.
      So we now raise a 415 Unsupported Media Type error through a
      _json_body() helper function every times we need to decode JSON body of
      incoming requests. Notice that since json module only has
      JSONDecodeError exception on Python3+, we catch ValueError on Python2.
      A functional test is added for entity creation view.
  22. 26 Jun, 2018 3 commits
  23. 19 Jun, 2018 1 commit
    • Denis Laxalde's avatar
      Use resource interfaces for context of API views · fe8187f8d252
      Denis Laxalde authored
      We define interfaces (using zope.interface) for main resource classes
      and refer to these interfaces (as dotted names) in API views' context
      instead of registering these views against the resource classes
      The idea is to make it possible for downstream applications to register
      their own resource classes that could be selected by standard API views.
      Interfaces have attributes and methods declared based on what appears to
      be needed on API views. We use interface inheritance to reduce
      duplication (e.g. the IMapped interface is a base for all interface but
      IRoot; IRelatedEntities is a base for IRelatedEntity).
      Notice that this somehow conflicts with the Mappable abstract class that
      was defined previously in resources module; so we drop this abstract
      class and replace it by an IMapped interface.
  24. 20 Jun, 2018 1 commit
    • Denis Laxalde's avatar
      Move permission check logic from get_entities() view to the resource · 52dcc1f1a143
      Denis Laxalde authored
      Instead of assuming that the context resource in get_entities() view has
      an "etype" attribute (which won't be true anymore in next changeset), we
      delegate permission check to the resource object in the form of an
      has_perm() method. This is step towards defining abstract interfaces for
      resource classes.
  25. 19 Jun, 2018 2 commits
    • Denis Laxalde's avatar
      Implement attributes of Paginable resource as properties · 62934d2097ac
      Denis Laxalde authored
      I'm getting into trouble while trying to reuse this class in a multiple
      inheritance context because the proper __init__ method is never called.
      So, let's get rid of __init__ in Paginable and implement 'limit',
      'offset' and '_has_next' attributes, previously defined in __init__ as
      reified properties. Notice that, since _has_next may be changed (in
      paginate() method), we also need a setter for this property.
      Accordingly, drop super() calls in resource classes inheriting from
      Paginable and mention that this class should be used as a mixin.
    • Denis Laxalde's avatar
      Add a CollectionMapper for unspecified entity types · 62523c338920
      Denis Laxalde authored
      This is useful for representing collection of heterogeneous entities.
      This mapper would be selected by its regid only, with no extra argument
      in contrast with other 'jsonschema.collection' mappers that either
      accepts an "etype" parameter or a relation context. This mapper does not
      handle submission (i.e. entity creation) since the target entity type is
      unspecified; so we return a "false" JSON Schema for "creation" role.
      In tests, we rename prior test case CollectionMapperTC as
      EntityCollectionMapperTC and add back a CollectionMapperTC explicitly
      testing the new mapper class.
  26. 02 May, 2018 1 commit
  27. 17 Apr, 2018 1 commit