docs: add openAPI spec, add nix-shell #1046
Conversation
|
Hi, what's nix shell? And what's the added advantage of using it? |
Howdy @Naramsim! The nix-shell is an interactive shell that's created using a nix expression (in this case the The advantage is optional for most, but it let's anyone who uses nix to run |
|
As i read this, its nix-shell is nothing that is needed, but nice to have and nothing that hurts to be included for the convenience of developers on NixOS |
|
Hi! Thanks for all the commits! When you are ready and the tests are passing you can ping me or request a review |
|
Ok thanks! Maybe @ryu-0729 can also review this. I'm really unsure which PR should I merge in, tbh. Both of you have made a great work |
ryu-0729
left a comment
There was a problem hiding this comment.
@Indyandie @Naramsim
I have reviewed it.
The way you divided the tags and set up the schema was very helpful.
I have added a comment and whould be happy if you could check it out.
Thanks.
| queryset = Ability.objects.all() | ||
| serializer_class = AbilityDetailSerializer | ||
| list_serializer_class = AbilitySummarySerializer | ||
|
|
There was a problem hiding this comment.
Some retrieve APIs allow passing name as a path parameter.
I was thinking that a string would be better than an integer, but what do you think?
It can be defined by overriding the retrieve method of PokeapiCommonViewset.
@extend_schema(
parameters=[
OpenApiParameter(
name="id",
description="This parameter can be a string or an integer.",
location=OpenApiParameter.PATH,
type=OpenApiTypes.STR,
),
]
)
def retrieve(self, request, pk=None):
return super().retrieve(request, pk)There was a problem hiding this comment.
Yes, we can treat IDs like strings
|
@Naramsim @ryu-0729 I put together a mockup of the pokeapi.co using this OpenAPI document and astro starlight. |
|
Hi! Are you still here? I got back for a while! I think I'll merge this PR since it's too long we have it open. Honestly, I couldn't decide which one to merge and I decided to go with @Indyandie one since he seems a bit more active on GitHub than @ryu-0729 (in no way I'm criticizing your work or your profile). |
|
@Naramsim still here 🙋♂️ Let me know if we need anything else to merge. Probably need some instructions in the README? |
|
I'll merge this otherwise another 3 months will pass :) What kind of info do you want to include on the README? I'd put this command in the Makefile.
I was thinking that maybe we can also link the openapi.yml over at pokeapi.co |
|
A PokeAPI/api-data refresh has started. In ~45 minutes the staging branch of PokeAPI/api-data will be pushed with the new generated data. |
|
The updater script has finished its job and has now opened a Pull Request towards PokeAPI/api-data with the updated data. |
nix-shellsupport via thedefaults.nix.To generate pokeapi OpenAPi document run:
To start the
nix-shellrun:Fixes #528