Coder Social home page Coder Social logo

Comments (9)

andreaselia avatar andreaselia commented on May 9, 2024 1

Hi @sunxyw, thank you for reporting this issue.

I believe I've managed to reproduce this in #72, so will work on a fix when I get a little time. If you have any suggestions towards a fix, feel free to message over on the PR 😄

(cc: @tomirons)

from laravel-api-to-postman.

sunxyw avatar sunxyw commented on May 9, 2024 1

Good, please take your time, this is not in a hurry.

from laravel-api-to-postman.

andreaselia avatar andreaselia commented on May 9, 2024 1

This has now been resolved in the latest release. Thanks again for your help on the issue.

from laravel-api-to-postman.

andreaselia avatar andreaselia commented on May 9, 2024

#72 stops this throwing an error, we still don't have support for custom rules at this moment in time though.

from laravel-api-to-postman.

sunxyw avatar sunxyw commented on May 9, 2024

This error still presents even updated to the latest version v1.12.1.

圖片

from laravel-api-to-postman.

andreaselia avatar andreaselia commented on May 9, 2024

Weird, I thought the test case would have caught this. I’ll take a look at this when I get back home in a few hours.

cc: @tomirons

from laravel-api-to-postman.

sunxyw avatar sunxyw commented on May 9, 2024

I tried fixing it myself, maybe it wasn't the best way, but it did get rid of the error.

if (is_array($rules)) {
$this->validator = Validator::make([], [$attribute => implode('|', $rules)]);

if (is_array($rules)) {
    foreach ($rules as $i => $rule) {
        if (is_object($rule)) {
            unset($rules[$i]);
        }
    }
    $this->validator = Validator::make([], [$attribute => implode('|', $rules)]);

from laravel-api-to-postman.

andreaselia avatar andreaselia commented on May 9, 2024

Hi @sunxyw,

I'll be taking a look at this today, I had a bit of a busy day yesterday so didn't get round to it.

Thanks for posting your solution. I'll need to be able to reproduce this through a unit test before I can submit a fix though.

Do you have any ideas how we could maybe reproduce it in a unit test?

from laravel-api-to-postman.

andreaselia avatar andreaselia commented on May 9, 2024

Okay, I managed to reproduce it. It's when a rule class is within an array of rules.

from laravel-api-to-postman.

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.