This is a demonstrator for hatch hooks presented at Python Rennes Meetup 04-2024.
The example is a server specified through openAPI v3.0 specification using connexion.
The hatch hook examples are:
- version source from openAPI spec
- metadata source from openAPI spec; for authors, description and license
- build hook producing Python client from the openAPI spec and in installation in editable mode creates a dummy README file for the client
Table of Contents
pip install hatch-demo
- Run the server
pip install -e .
python -m hatch_demo
- Test a request
Using httpie:
http POST http://localhost:8080/openapi/greeting/john
# or
# curl -X POST http://localhost:8080/openapi/greeting/john
You should see:
Hello john
hatch-demo
is distributed under the terms of the MIT license.