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

docs: add openAPI spec, add nix-shell #1046

Merged
merged 55 commits into from May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
082ea57
Updating MoveDetailSerializer to change $effect_chance to actual number
SKCwillie Feb 2, 2024
ffa89bd
fixing a debugging print line
SKCwillie Feb 2, 2024
74b4d0a
replacing move_effect_prose.csv with original
SKCwillie Feb 2, 2024
41818e4
removing unnecessary line
SKCwillie Feb 4, 2024
d234ef9
that line was needed after all
SKCwillie Feb 4, 2024
74bb5b2
fixing linter issue
SKCwillie Feb 10, 2024
6775022
making simonorono's suggest changes
SKCwillie Feb 11, 2024
4bc132d
docs(openapi): add `drf-spectacular` and default settings
Indyandie Feb 24, 2024
7f2d2bd
docs(openapi): update spectacular settings
Indyandie Feb 24, 2024
3a1f9db
docs(openapi): update `SERVERS`
Indyandie Feb 24, 2024
701f2a7
docs(openapi): add `openapi.yml`
Indyandie Feb 24, 2024
c2d34ea
ci: add `nix-shell`
Indyandie Feb 24, 2024
9e3c622
Merge branch 'master' into openapi-nix
Indyandie Feb 24, 2024
0e51181
docs(openapi): add operation descriptions
Indyandie Feb 26, 2024
ee05763
Merge branch 'openapi-nix' of github.com:Indyandie/pokeapi into opena…
Indyandie Feb 26, 2024
9085223
docs(openapi): update `openapi.yml`
Indyandie Feb 26, 2024
5e1c02b
docs(openapi): add tags (groups)
Indyandie Feb 26, 2024
0747104
docs(openapi): add path summary
Indyandie Feb 28, 2024
61c4cd0
fix: resolve drf-spectacular warnings, add schema_field definitions
Indyandie Mar 1, 2024
5ee7cdd
docs: update summary
Indyandie Mar 1, 2024
adc66c0
fix: add schema_field definitions
Indyandie Mar 2, 2024
ddeaeeb
fix: add `item` schema_field definitions
Indyandie Mar 3, 2024
3c9d27b
conf(drf-spectacular): set `COMPONENT_SPLIT_REQUEST`
Indyandie Mar 3, 2024
9285079
fix: add `nature` schema_field definitions
Indyandie Mar 3, 2024
e7ea8b2
fix: add `move` schema_field definitions
Indyandie Mar 3, 2024
ef97bc6
fix: add `pal-park-area` schema_field definitions
Indyandie Mar 3, 2024
3bb6038
fix: add `pokemon-form` schema_field definitions
Indyandie Mar 3, 2024
fe9c1fa
fix: add `move_learn_method` schema_field definitions
Indyandie Mar 3, 2024
38f67d0
fix: add `pokemon_shape` schema_field definitions
Indyandie Mar 3, 2024
029f663
fix: add `pokemon` schema_field definitions
Indyandie Mar 4, 2024
0fabe2c
fix: add `pokemon-species` schema_field definitions
Indyandie Mar 4, 2024
da11f73
fix: add `evolution-chain` schema_field definitions
Indyandie Mar 4, 2024
8060b59
fix: add `pokeathlon_stat` schema_field definitions
Indyandie Mar 4, 2024
807fbc1
fix: add `pokedex` schema_field definitions
Indyandie Mar 4, 2024
8198fae
fix: add `version-group` schema_field definitions
Indyandie Mar 4, 2024
5c9a73d
fix: add `pokemon_encounters` `200` response
Indyandie Mar 4, 2024
cfff93d
global tags
Indyandie Mar 4, 2024
2b794c0
global tags
Indyandie Mar 4, 2024
c7c2c46
typo
Indyandie Mar 4, 2024
0887679
Merge branch 'master' into openapi-nix
Indyandie Mar 5, 2024
4688b0d
tidy
Indyandie Mar 5, 2024
ae48dae
docs(openapi): update `openapi.yml`
Indyandie Mar 5, 2024
e51c11e
ci(nix-shell): add `black`
Indyandie Mar 5, 2024
d772620
test: `make format`
Indyandie Mar 5, 2024
7ecca70
Merge branch 'master' into openapi-nix
Indyandie Mar 5, 2024
77a4570
fix: misplace `required` (PR review)
Indyandie Mar 7, 2024
89e5533
feat: id parameter (not working)
Indyandie Mar 7, 2024
a5aff84
docs: overview
Indyandie Mar 7, 2024
777abcc
docs: overview
Indyandie Mar 7, 2024
5e02a37
fix: use correct type, add format
Indyandie Mar 27, 2024
a5158e2
fix: use `examples` property (`example` is deprecated), fix typo
Indyandie Mar 28, 2024
bf195f9
chore: `make format`
Indyandie Mar 28, 2024
31beff3
Merge branch 'master' into openapi-nix
Indyandie Apr 5, 2024
7ea210f
bump: drf-spectacular `0.27.2`
Indyandie Apr 5, 2024
d471272
Merge branch 'master' into openapi-nix
Naramsim May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions config/settings.py
Expand Up @@ -99,6 +99,7 @@
"corsheaders",
"rest_framework",
"cachalot",
"drf_spectacular",
) + CUSTOM_APPS


Expand All @@ -116,6 +117,7 @@
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
"PAGE_SIZE": 20,
"PAGINATE_BY": 20,
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
}


Expand All @@ -136,3 +138,27 @@
]

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

SPECTACULAR_SETTINGS = {
"TITLE": "pokeapi",
"DESCRIPTION": "A RESTful API for Pokémon.",
"SERVERS": [{"url": "https://pokeapi.co"}],
"EXTERNAL_DOCS": {"url": "https://pokeapi.co/docs/v2"},
"VERSION": "2.7.0",
"SERVE_INCLUDE_SCHEMA": False,
"OAS_VERSION": "3.1.0",
"COMPONENT_SPLIT_REQUEST": True,
"TAGS": [
"pokemon",
"evolution",
"berries",
"items",
"machines",
"location",
"contest",
"moves",
"encounters",
"games",
"utility",
],
}
42 changes: 42 additions & 0 deletions default.nix
@@ -0,0 +1,42 @@
with import <nixpkgs> { };

let
pythonPackages = python3Packages;
in pkgs.mkShell rec {
name = "impurePythonEnv";
venvDir = "./.venv";
buildInputs = [
python310Packages.python
python310Packages.venvShellHook

# python310Packages.coverage
# python310Packages.python-mimeparse
# python310Packages.python-dateutil
# python310Packages.drf-spectacular
# python310Packages.djangorestframework
# python310Packages.django-redis
# python310Packages.django-cors-headers

# Required dependancies
black
taglib
openssl
git
libxml2
libxslt
libzip
zlib
];

# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';

postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';

}