Azure / azure-functions-python-library

Azure Functions Python SDK
MIT License
150 stars 63 forks source link

Inconsistent naming get_json() in EventGridEvent and EventGridOutputEvent #159

Open pjung-bosch opened 1 year ago

pjung-bosch commented 1 year ago

Both mentioned classes have methods called get_json which return the classes __data field. This seems odd for two reasons:

  1. They don't actually return JSON but a dict (if the typing hints in __init__ are correct). In any case this is a major source of confusion.
  2. All other getters are implemented as properties. (So why not just do the same here?)

https://github.com/Azure/azure-functions-python-library/blob/44712a77ce6ba68065d1c16ed6015bb998ddfe48/azure/functions/_eventgrid.py#L33-L34

https://github.com/Azure/azure-functions-python-library/blob/44712a77ce6ba68065d1c16ed6015bb998ddfe48/azure/functions/_eventgrid.py#L86-L87