Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2755
Summary
ai.timefold.solver.service.definition.api.metrics.Metricwithtitle,description,example,format(defaults toDataFormat.Values.NUMBER),minimum(defaults to"0",""to omit), andpriority(defaults to-1for 1-based declaration order).@Metricat build time intimefold-solver-service-quarkus-deploymentviaAddToOpenAPIDefinitionBuildItem(MetricOpenApiFilter) using Jandex metadata (MetricMetadataResolver) without runtime reflection, keeping static build-time OpenAPI specs complete.TimefoldModelDescriptorProcessorto read@Metric(while keeping@Schemabackward compatibility) intoInputMetricDescriptorandOutputMetricDescriptor.EmployeeScheduleInputMetricsandEmployeeScheduleOutputMetricsinservice/test-modeland updateservice/test-model/src/build/openapi.jsonvia-Dupdate-api(inferredintegertype andminimum: 0).docs/src/modules/ROOT/pages/running-timefold-solver/service/exposing-metrics.adocwith@Metricexamples.Implementation Notes
3.40.1.2,SmallRyeOpenApiProcessor.smallryeOpenApiIndex(...)buildsOpenApiFilteredIndexViewBuildItemdirectly fromCombinedIndexBuildItem+BeanArchiveIndexBuildItem, soAddToOpenAPIDefinitionBuildItemis used to apply@Metricexpansion at build time without runtime reflection.example(singular) becausequarkus.smallrye-openapi.open-api-versionis locked to3.0.3.Tests
MetricAnnotationOpenApiTest(Quarkus extension test verifying OpenAPI output andtimefold-model-descriptor.jsonfor records, classes, methods, declaration-order priority, explicit priority,minimumomission,Duration, and@Schemafallback).MetricOpenApiFilterTest(unit tests for invalidminimum, missing schema targets, example parsing, and@JsonProperty/@Schema(name)property resolution).OpenApiTestinservice/test-model../mvnw -pl service/definition,service/quarkus/deployment install,./mvnw -pl service/quarkus/integration-tests verify,./mvnw -B verify --file service/test-model/pom.xml, and./mvnw -pl docs generate-resources -Dfull.