Coder Social home page Coder Social logo

Consistancy on API Endpoints about publicapi HOT 4 CLOSED

djotaku avatar djotaku commented on May 10, 2024
Consistancy on API Endpoints

from publicapi.

Comments (4)

timmixell avatar timmixell commented on May 10, 2024

@djotaku this was done by design. The challenge with anonymous donors becomes what we return. Any individual donation can be marked as anonymous, while the donor display information is deliberately public. We don't want to provide any detail that might disclose the donor if they indicated a private donation. That would mean we'd have to omit donorID for anonymous donors in the list (as we do in /donations), effectively treating each anonymous donation as a separate donor.

I'd love to hear more about your problem to solve and how we might be able to help. Thanks!

from publicapi.

djotaku avatar djotaku commented on May 10, 2024

So here's how I'm currently handling anonymous donations: https://github.com/djotaku/ELDonationTracker/blob/master/eldonationtracker/donation.py

If you look at lines 79-87 - you'll see that I deal with the fact that the endpoint doesn't provide names or amounts for anonymous donations by setting the name to Anonymous and the amount to 0. This allows the user to still see that he/she got a donation. And if the anonymous donor left a message, the message can still be displayed.

I would like to do the same with Donors. But they simply don't appear on the donor endpoint. Well, the Anonymous donor wouldn't have a message. But they would have a name (which could be set to Anonymous) and an amount. I use that plus the SQL query to create a list of the top Donors. So I could have Anonymous as one of the donors with an amount. But, sure, maybe if you have an amount there then it can be traceable back and you're trying to protect privacy. It's all well and good UNLESS the participant ONLY has Anonymous donors. Like the person who filed the bug report with me that the program kept crashing for him. Turns out that since the Donor endpoint was empty it was causing issues because my program was saying:

"Hey, this guy has donations, so I should check the donor endpoint"

and then the endpoint came back empty. So my workaround ended up having to be https://github.com/djotaku/ELDonationTracker/blob/master/eldonationtracker/participant.py on lines 240 to add the extra check of the top donor not being None. Because, again, LOGICALLY, it's absurd to have donations without donors.

Let me know if there's anything that could meet the goal of privacy plus a more consistent output. I mean, this is potentially pretty corner-case. How many users ONLY have anonymous donors? Just so happened that the person who opened the bug report with me only had one donor AND that donor happened to be anonymous. If not, if you haven't already done so, you may wish to update the API documentation to reflect that this is a situation that can happen.

from publicapi.

timmixell avatar timmixell commented on May 10, 2024

@djotaku thanks for the additional context! I'll take it back to the team, but I'm not sure we'll be able to accommodate this before game day 😢

from publicapi.

timmixell avatar timmixell commented on May 10, 2024

@djotaku this is resolved in v1.3 of the API. note this is live, we're just wrapping up the additions and edits to some other parts of the docs

from publicapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.