julian_knight
09/19/2022, 10:42 PMOpenApiStream
class. It doesn't generate streams from a swagger spec, but it does use the base url and response schema from it, which still saves a lot of time over defining schemas by hand: https://github.com/rabidaudio/tap-lichess/blob/main/tap_lichess/openapi.py
• If anyone ever needs to do streaming requests, there's an example in GamesStream. Basically enable stream mode in the session with requests_session.stream = True
and then override parse_response
• Posting a request body that isn't json wasn't hard but I did have to re-implement prepare_request
. RESTStream
seems to assume all bodies are json (which seems pretty reasonable to me)visch
09/19/2022, 11:09 PMjulian_knight
09/19/2022, 11:16 PMI'm not a great chess playerMe neither!
julian_knight
09/19/2022, 11:17 PMOpenApi3Stream
didn't work very well here, it seems Lichess doesn't follow their own schema, returning nulls for non-null fields 😞edgar_ramirez_mondragon
09/19/2022, 11:25 PMrequests_session.stream = True
plus simple custom parse_response
just works 😄visch
09/20/2022, 1:24 PM