Giter Club home page Giter Club logo

Comments (4)

justinas avatar justinas commented on July 21, 2024

Seems like there are multiple discrepancies between the API and V4 structs in the library. E.g. is_valid is assumed to be present, but I can find no mention it in the docs for API V4.

Manual testing via curl also shows no is_valid field:

$ curl --user 'api:***' -G \
    https://api.mailgun.net/v4/address/validate \
    --data-urlencode address='[email protected]'

{"address":"[email protected]","is_disposable_address":false,"is_role_address":false,"reason":["unknown_provider"],"result":"deliverable","risk":"medium"}

$ curl --user 'api:***' -G \
    https://api.mailgun.net/v4/address/validate \
    --data-urlencode address='foo@'

{"address":"foo@","is_disposable_address":false,"is_role_address":false,"reason":["malformed address; failed parse checks"],"result":"undeliverable","risk":"high"}

I would assume result has superseeded is_valid in the newer versions of API. Perhaps if the same result structure is used for both V3 and V4 in the library, IsValid should be mapped according to result and perhaps other fields.

from mailgun-go.

riskimidiw avatar riskimidiw commented on July 21, 2024

Yeah, I think in this library they want to ensure the backward compatibility between v3 and v4, so that's why it's used the same struct in v3 and v4

Mapping the result values into is_valid field would not solve the problem when we want to handle different logic based on the result values. Because is_valid only contains true or false.

If we look at this PR #244, he just adds some new field in v4EmailValidationResp and EmailVerification struct

from mailgun-go.

thrawn01 avatar thrawn01 commented on July 21, 2024

@riskimidiw Let me know if I missed anything. #265

from mailgun-go.

riskimidiw avatar riskimidiw commented on July 21, 2024

@thrawn01 LGTM, Thank you for working on this issue 🙏🏻

from mailgun-go.

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.