Package: nirum-wsgi
Nirum services as WSGI appsThis package providesnirum_wsgi.WsgiAppclass which adapts a given
Nirum service to a WSGI application:fromyourserviceimportYourServicefromnirum_wsgiimportWsgiAppclassYourServiceImpl(YourService):...app=WsgiApp(YourServiceImpl())There’s a development-purpose CLI launcher namednirum-serveras well:nirum-server-H0.0.0.0-p8080--debug'yourserviceimpl:YourServiceImpl()'ChangelogVersion 0.3.0Released on May 25, 2018.Became ready for theNirum 0.4.0compiler.  Instances of service classes
generated by the compiler older than the version 0.4.0 is supported throughLegacyWsgiApp.  Note that the constructor ofWsgiAppdetects
which version of compiler is the given service object generated from,
and if it’s older than 0.4.0 automatically returns an instance ofLegacyWsgiAppinstead ofWsgiApp, for backward compatibility.An400 Bad Requesterror response for invalid method arguments became
to have a more field namederrorswhich contains one or more errors.
Its format is like:{"message":"There are invalid arguments.","errors":[{"path":".author.name","message":"Expected a string."},{"path":".tags","message":"Expected an array."}]}WsgiApphad been an old-style class in Python 2.  It’s now a new-style
class.  No change on Python 3 (since there’s no old-style class in Python 3.)AddedMethodArgumentErrorto store multiple errors during
deserialization of method arguments.WsgiApp.error()andWsgiApp.make_error_response()methods became able
to take extra keyword arguments to extend the result JSON object.Version 0.2.2Released on March 20, 2018.Fixed a runtimeTypeErrorthat had been raised when a parameter
corresponding to a variable for a query string in@http-resourceannotation’s path has an optional type.  [#251by Chang-soo Han]Version 0.2.1Released on March 20, 2018.Fixed a runtimere.error(sre_constants.error) that had been raised
when a variable name for a query string has one or more hyphens
in@http-resourceannotation’spath.  [#250by Chang-soo Han]Version 0.2.0Released on February 4, 2018.Made parameters having an optional type possible to be omitted. [#205]Added method dispatching by querystring pattern
e.g.,@http-resource(method="GET",path="/users?from={from}&to={to}").
[#130]Added basic method dispatching by path pattern (URI template) throughhttp-resourceannotation, e.g.,@http-resource(method="GET",path="/users/{login}/works/{work-id}/").
[#130]Addedallowed_originsandallowed_headersoptions forCORStoWsgiAppconstructor.  It supports simple wildcard (*) pattern syntax
as well.AddedAnnotationError,NoJsonError, andServiceMethodErrorexceptions.Since returning a disallowed value which does not match to the return type
is the fault the server-side made, the HTTP status code for the case became500 Internal Server Errorinstead of400 Bad Request.
Also now it writes logs usingloggingmodule.For the mistakes returningNonefrom a method having non-null return type,
now it became to show a more readable and debug-friendly message with a proper
response instead of uncaught Python exception.WsgiApp.url_mapattribute was gone./ping/resource was gone.Fixednirum-servercommand able to import a Python module/package from
the current working directory (.; CWD).Version 0.1.0Released on July 10, 2017.