package com.cameleer.server.app.web;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Injects the {@link com.cameleer.server.core.runtime.Environment} identified by the
 * {@code {envSlug}} path variable. Returns 404 if the slug does not exist.
 * <p>
 * Use on handlers under {@code /api/v1/environments/{envSlug}/...}:
 * <pre>{@code
 * @GetMapping("/api/v1/environments/{envSlug}/apps")
 * public List<App> list(@EnvPath Environment env) { ... }
 * }</pre>
 */
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface EnvPath {
}
