Giter VIP home page Giter VIP logo

dummy4j's People

Contributors

actions-user avatar daniel-frak avatar little-pinecone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

little-pinecone

dummy4j's Issues

Demo project for Dummy4j

A demo project presenting:

  1. Functionality (basic usage)
  2. Modules (selected, with configurable builders)
  3. Expression resolver (advanced usage)
  4. Commerce usage example

Builders - enable reuse through with/without parity

We should allow all builders to be reusable by 'undoing' any methods called on them. In this case I mean that everywhere we have a withoutX, like in CreditCardNumberBuilder and CreditCardBuilder (withoutFormatting), we should also have a withFormatting method.

MissingLocaleException when using Dummy4j in a Spring Boot jar

Example application: efficient-mvp-example

After building application with the following command:

mvn clean package && java -jar -Dspring.profiles.active=dev,init target/efficient-mvp-example-0.0.1-SNAPSHOT.jar 

and making the http://localhost:8080/api/init?seed=1&how-many-books=100 request I'm getting MissingLocaleException.

The logs show:
Loading definitions from: [BOOT-INF/classes/dummy4j/en/book.yml]
instead of
Loading definitions from: [dummy4j/en/book.yml, โ€ฆ]

Adding another condition specifically for Spring Boot projects in YamlFileLoader::isInAllowedPath seems to fix the problem, but there must be a better way that doesn't require hardcoding:

    private boolean isInAllowedPath(String resource, List<String> paths) {
        boolean isInAllowedPath = false;
        for (String path : paths) {
            if (resource.startsWith(path) || resource.startsWith("BOOT-INF/classes/" + path)) {
                isInAllowedPath = true;
                break;
            }
        }

        return isInAllowedPath;
    }

Useful links:
Resource pattern filter for complete resource path #148

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.