Code Monkey home page Code Monkey logo

vng-api-common's Introduction

VNG-API-common - Tooling voor RESTful APIs

Build status Code quality checks Coverage status Documentation Status black

python-versions django-versions pypi-version

VNG-API-common biedt generieke implementaties en tooling voor RESTful APIs in een Common Ground gegevenslandschap.

De tooling wordt o.a. gebruikt in de referentie-implementaties van componenten voor zaakgericht werken, maar ook in VNG-APIs voor referentielijsten en de Gemeentelijke Selectielijst.

Zie de uitgebreide documentatie voor de features en het gebruik.

Features

  • Centraal beheer van constanten die de verschillende componenten overstijgen
  • GeoJSON OpenAPI definities
  • Support voor Geo CRS negotation
  • Ingebouwde support voor nested viewsets met declaratievere syntax voor registratie
  • Vaak voorkomende validators:
    • RSIN/BSN validator
    • Numerieke waarde validator
    • Niet-negatieve waarde validator
    • Alfanumerieke waarde (zonder diacritics)
    • URL-validator (test dat URL bestaat) met pluggable link-checker
    • UntilNowValidator - valideer datetimes tot en met nu.
    • UniekeIdentificatieValidator (in combinatie met organisatie)
    • InformatieObjectUniqueValidator om te valideren dat M2M entries slechts eenmalig voorkomen
    • ObjectInformatieObjectValidator om te valideren dat de synchronisatie van een object-informatieobject relatie pas kan nadat deze relatie in het DRC gemaakt is
    • IsImmutableValidator - valideer dat bepaalde velden niet gewijzigd worden bij een (partial) update, maar wel mogen gezet worden bij een create
    • ResourceValidator - valideer dat een URL een bepaalde resource ontsluit
  • Custom inspectors voor drf-yasg:
    • Support voor rest_framework_gis GeometryField
    • SUpport voor django-extra-fields Base64FieldMixin
    • URL-based related resource filtering (django-filter support)
    • verzameling van mogelijke error-responses per operation
  • Management command generate_swagger overloaded
    • neemt default versie mee en maakt server-informatie domein-agnostisch
    • optie om informatiemodel-resources naar markdown te renderen met backlinks naar gemmaonline.nl
  • Support voor ISO 8601 durations
  • Custom model fields:
    • RSINField
    • BSNField
    • LanguageField
    • VertrouwelijkheidsAanduidingField
    • DaysDurationField
  • Mocks voor de validators die netwerk IO hebben, eenvoudig via @override_settings toe te passen
  • Test utilities
  • Optionele notificaties applicatie:
    • ontvangen van webhook events
    • configureren en registreren van notificatiecomponent/webhooks

vng-api-common's People

Contributors

ahnroxit avatar annashamray avatar damm89 avatar joeribekker avatar joerivrij avatar matthijsbekendam avatar sergei-maertens avatar shea-maykinmedia avatar sonnyba avatar stevenbal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vng-api-common's Issues

FilterParameter can't be pickled during caching when retrieving reDoc OAS

Issue occurred in CI for catalogi API: https://github.com/VNG-Realisatie/catalogi-api/pull/116/checks?check_run_id=1550996968#step:8:15503

Version 1.0.44 introduced the following: 22968a6#diff-aaa7048a6193623a30d02f47eb1c0ac30a3acc22684b5ea44da7e4e4ca66b2e8R33

This causes issues down the line when attempting to cache the reDoc view, because some filters from django_filters (such as ConcreteInFilter are locally declared (and thus can't be pickled).

Make VNG API Common Django 3.2 compatible

Currently vng api common is pinned to < Django 3.0, but 2.2 is end of life in April this year and this library currently blocks upgrading CMIS adapter and Open Zaak to 3.2 LTS.

Tasks

  • Update the tox.ini envlist to support the following matrix of versions
    • Python 3.7 - Django 2.2
    • Python 3.8 - Django 2.2
    • Python 3.7 - Django 3.2
    • Python 3.8 - Django 2.2
  • Update the Github CI workflow to support the same matrix
  • Make the necessary changes to the package to support Django 3.2
  • Resolve the Django 4 upgrade warning
  • Update the package metadata to correctly reflect the supported versions
  • Extra: see if we can add Python 3.9 and Python 3.10 support

Breaking changes released as minor version

I see that #225 was merged and released via #226 as a minor release, but you did breaking changes that affect our projects.

Derived projects making use of vng-api-common (like https://github.com/open-zaak/open-zaak) are affected by this and you not adhering to semantic versioning. You are now forcing us to deal with massive changes in tooling in a minor release, and frankly, this is not acceptable.

Please yank the 1.11 release from PyPI and release this properly as 2.0, but it would also have been nice to check and give downstream projects time to test out these changes and adapt to them.

Use constants instead of strings.

We should use constants instead of typing these over and over:

The notification component uses actions, like: 'list', 'read', etc.:
https://github.com/VNG-Realisatie/vng-api-common/pull/22/files#diff-fc3d84d47d024001d3713b8e75cdc904R51

And here we check for 'autorisations' as channel name. Maybe all "known" channel names should be in the project, just like the ComponentTypes enum is now:

https://github.com/VNG-Realisatie/vng-api-common/pull/22/files#diff-06900288ee127189c9c4ddc826634dddR95

Support PyJWT 2.0.0+

There's a breaking change . encode and decode no longer operate on bytestrings, but on regular strings now. It's been dealt with in gemma-zds-client already.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.