From 92fd9e9c4cae0ead17b2718c35b96af7ac038d50 Mon Sep 17 00:00:00 2001 From: InspectorCaracal Date: Mon, 21 Nov 2022 13:26:56 -0700 Subject: [PATCH] add conclusion --- docs/source/Howtos/Extending-the-REST-API.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/Howtos/Extending-the-REST-API.md b/docs/source/Howtos/Extending-the-REST-API.md index aad78189e1..b478337cd6 100644 --- a/docs/source/Howtos/Extending-the-REST-API.md +++ b/docs/source/Howtos/Extending-the-REST-API.md @@ -416,6 +416,12 @@ class CharacterViewSet(ObjectDBViewSet): return Response( InventorySerializer(obj).data, status=status.HTTP_200_OK ) ``` -One last `evennia reboot` - now you should be able to get `/api/characters/1/inventory` and see everything your character has, neatly divided into worn and carried. +One last `evennia reboot` - now you should be able to get `/api/characters/1/inventory` and see everything your character has, neatly divided into "worn" and "carried". -And that's it! \ No newline at end of file +## Next Steps + +That's it! You've learned how to customize your own REST endpoint for Evennia, add new endpoint details, and serialize data from your game's objects for the REST API. With those tools, you can take any in-game data you want and make it available - or even modifiable - with the API. + +If you want a challenge, try taking what you learned and implementing a new `desc` detail that will `GET` the existing character desc, or `PUT` a new desc. (Tip: check out how evennia's REST permissions module works, and the `set_attribute` methods in the default evennia REST API views.) + +> For a more in-depth look at the django REST framework, you can go through [their tutorial](https://www.django-rest-framework.org/tutorial/1-serialization/) or straight to [the django REST framework API docs](https://www.django-rest-framework.org/api-guide/requests/) \ No newline at end of file