Git Product home page Git Product logo

Comments (10)

graemerocher avatar graemerocher commented on May 27, 2024 3

https://github.com/kestra-io/kestra/blob/develop/core/src/main/java/io/kestra/core/services/TaskGlobalDefaultConfiguration.java#L11

@ConfigurationProperties(value = "kestra.tasks")
@Getter
public class TaskGlobalDefaultConfiguration {
    List<TaskDefault> defaults;
}

Is better expressed as:

@ConfigurationProperties(value = "kestra.tasks.defaults", list=true)
public class TaskDefault {
    private final String type;

    @Builder.Default
    private final boolean forced = false;

    @MapFormat(transformation = MapFormat.MapTransformation.NESTED, keyFormat = StringConvention.RAW)
    private final Map<String, Object> values;
}

Then inject List<TaskDefault>.

Also ideally git rid of Lombok 🤢🤮

from kestra.

tchiotludo avatar tchiotludo commented on May 27, 2024 1

I couldn't find any other solution than a custom TypeConverter, but seems to work

from kestra.

brian-mulier-p avatar brian-mulier-p commented on May 27, 2024

Hello ! After hours of digging I found an edge case in Micronaut which leads to such behaviour. I openned an issue. Meanwhile, adding at least a third UPPERCASE letter before the "_" should solve the issue (ABC_VALUE for eg.)

from kestra.

yuri1969 avatar yuri1969 commented on May 27, 2024

@brian-mulier-p I appreciate the effort!

from kestra.

graemerocher avatar graemerocher commented on May 27, 2024

where is the source for the configuration properties definition of this?

from kestra.

graemerocher avatar graemerocher commented on May 27, 2024

generally if you want to raw keys you need to do this https://github.com/micronaut-projects/micronaut-sql/blob/1dd793b4f4f3bf85c729a355c1773f5df3efa2fe/hibernate-jpa/src/main/java/io/micronaut/configuration/hibernate/jpa/JpaConfiguration.java#L139

from kestra.

brian-mulier-p avatar brian-mulier-p commented on May 27, 2024

Hello ! Thank's for the help. I think I tried that already. I can try again tomorrow to make sure but basically it looks like the MapFormat annotation isn't taken care of when it goes through such hierarchy (List with Something having a Map inside)

from kestra.

brian-mulier-p avatar brian-mulier-p commented on May 27, 2024

Nvm I didn't try that exact example, that's because we're mixing objects from our YAML declaration with POJO for our global configuration. It's done to create a heavy relation between those but it brings some complexity around configuring annotation. I didn't try the list=true since the lower class (TaskDefault) isn't necessarily a list :'(

from kestra.

brian-mulier-p avatar brian-mulier-p commented on May 27, 2024

Btw I tried your sample but list = true seems not to exist 🤔

from kestra.

graemerocher avatar graemerocher commented on May 27, 2024

Sorry it should be @EachProperty

from kestra.

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.