Closed DEVizzent closed 1 year ago
Nice. I will do it :)
El sáb., 28 ene. 2023 9:21, Pavel Batanov @.***> escribió:
@.**** commented on this pull request.
In src/PSR7/Exception/Validation/InvalidBody.php https://github.com/thephpleague/openapi-psr7-validator/pull/184#discussion_r1089681398 :
@@ -17,7 +19,13 @@ public static function becauseBodyDoesNotMatchSchema( SchemaMismatch $prev ): self { $exception = static::fromAddrAndPrev($addr, $prev);
- $exception->message = sprintf('Body does not match schema for content-type "%s" for %s', $contentType, $addr);
- $exception->message = sprintf(
- 'Body does not match schema for content-type "%s" for %s. [%s in %s]',
- $contentType,
- $addr,
- substr($prev->getMessage(), 0, -1),
- implode('->', $prev->dataBreadCrumb()->buildChain())
I've got it. Testing doesn't have that much tooling indeed. What do you think about introducing some kind of global toggle like Validator/Debug::enable() (or maybe Verbose::enable() ) in order to make it configurable ? I really want to keep generic flow simple since these messages are not machine readable in any case and format (as I specified for oneOf and allOf) can be very debatable
— Reply to this email directly, view it on GitHub https://github.com/thephpleague/openapi-psr7-validator/pull/184#discussion_r1089681398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJW2WAUJCHXHDRUAYEQ2FITWUTJHPANCNFSM6AAAAAAUH7XCTA . You are receiving this because you authored the thread.Message ID: @.*** com>
Can you please use something meaningful in commit author? I'd like to preserve original authorship of commits in general, but have to squash and fix commits of previous PR because they have no name neither linked to github account via email of commit being linked to any GH account
Can you please use something meaningful in commit author? I'd like to preserve original authorship of commits in general, but have to squash and fix commits of previous PR because they have no name neither linked to github account via email of commit being linked to any GH account
Sure, I'll do it tomorrow morning. I will check the commit history to find some examples
Can you please use something meaningful in commit author? I'd like to preserve original authorship of commits in general, but have to squash and fix commits of previous PR because they have no name neither linked to github account via email of commit being linked to any GH account
Sure, I'll do it tomorrow morning. I will check the commit history to find some examples
@scaytrase Yesterday I didn't understand what you were saying, because I have properly configured my global user.name and user.email, but I don't know why I wasn't configured in this concret project :exploding_head: I configured and reset the commit author.
@scaytrase Can you confirm commit autor is now correct and merge? Thank you :+1: .
Looks good! Thanks. I'll merge it a bit later, sorry, a bit busy last days
thanks @DEVizzent !
Most of times we I use this lib for testing, validating request and responses according documentation y got InvalidBody message. So I have to debug when this exception is thrown to see the previous one and come across the root cause of the error. I used a try catch on my side to add more context to this error, but I think it can be usefull for all.
Don't provide any context about why it failed. With this change you will see:
Whith this message we can identify the root cause "User -> id" and the reason.