SmartMVC
All docs
Guide
Features
Authentication
Example
Reference
  • 简体中文
  • English
  • 日本語
  • Русский
GitHub
All docs
Guide
Features
Authentication
Example
Reference
  • 简体中文
  • English
  • 日本語
  • Русский
GitHub
  • Reference

    • Configuration reference
    • API reference

Configuration reference

Every property uses the prefix spring.smart.mvc. The defaults in these tables come from the core configuration models and are exposed to IDEs through the Starter's Spring Boot configuration metadata.

exception

PropertyTypeDefaultDescription
exception.enabledbooleantrueRegister the SmartMVC global exception handler
exception.status-modeHTTP_STATUS | ALWAYS_OKHTTP_STATUSUse the actual HTTP status, or always transport errors with status 200

response

PropertyTypeDefaultDescription
response.wrap-enabledbooleantrueWrap ordinary controller return values
response.wrap-voidbooleantrueWrap void and Void return values
response.success-messageStringsuccessThe message used for automatically created success responses
response.long-as-stringbooleantrueSerialize long and Long as strings

ApiResponse, byte[], Spring Resource, StreamingResponseBody, and ProblemDetail are never wrapped automatically.

date-time

PropertyTypeDefaultDescription
date-time.request-formatStringyyyy-MM-dd HH:mm:ssRequest pattern for date-time types
date-time.response-formatStringyyyy-MM-dd HH:mm:ssJSON output pattern for date-time types
date-time.date-request-formatStringyyyy-MM-ddRequest pattern for LocalDate
date-time.date-response-formatStringyyyy-MM-ddOutput pattern for LocalDate
date-time.time-request-formatStringHH:mm:ssRequest pattern for LocalTime
date-time.time-response-formatStringHH:mm:ssOutput pattern for LocalTime
date-time.zone-idStringsystem-defaultIANA time zone used when converting instant-based types and Date
date-time.incomplete-input-policyFILL_MISSING | REJECTFILL_MISSINGComplete or reject incomplete date-time input

The supported types are LocalDateTime, LocalDate, LocalTime, Instant, OffsetDateTime, ZonedDateTime, and java.util.Date. The latter four use the configured time zone during output.

validation

PropertyTypeDefaultDescription
validation.enabledbooleantrueLet SmartMVC integrate with and handle Spring MVC validation results; when disabled, SmartMVC configures a no-op validator

This switch does not install a Bean Validation implementation. The application must explicitly add spring-boot-starter-validation and manage its version; SmartMVC does not bring in a validation provider transitively.

request-log

PropertyTypeDefaultDescription
request-log.enabledbooleantrueLog the method, URI, status code, and elapsed time
request-log.levelTRACE | DEBUG | INFO | WARN | ERRORINFOLog level for the request summary

When a controller is matched, its class is used as the logger category.

auth

PropertyTypeDefaultDescription
auth.enabledbooleantrueEnable SmartMVC authentication and authorization checks; the interceptor itself remains registered
auth.modeGLOBAL | ANNOTATEDANNOTATEDAuthenticate every controller endpoint, or only endpoints marked with @Auth
auth.check-request-permissionbooleanfalseCheck METHOD:PATH permissions stored in the identity
auth.authorization-headerStringAuthorizationRequest header used to read credentials
auth.token-prefixStringBearerPrefix removed from the request-header value
auth.exclude-pathsString[][]Spring MVC path patterns that skip authentication completely

@Anonymous skips authentication in both modes. exclude-paths also always applies: in ANNOTATED mode, an excluded path does not enter the authentication interceptor even if its handler has @Auth. For all other paths, ANNOTATED processes only handlers marked with @Auth.

Complete YAML example

spring:
  smart:
    mvc:
      exception:
        enabled: true
        status-mode: HTTP_STATUS
      response:
        wrap-enabled: true
        wrap-void: true
        success-message: success
        long-as-string: true
      date-time:
        request-format: yyyy-MM-dd HH:mm:ss
        response-format: yyyy-MM-dd HH:mm:ss
        date-request-format: yyyy-MM-dd
        date-response-format: yyyy-MM-dd
        time-request-format: HH:mm:ss
        time-response-format: HH:mm:ss
        zone-id: system-default
        incomplete-input-policy: FILL_MISSING
      validation:
        enabled: true
      request-log:
        enabled: true
        level: INFO
      auth:
        enabled: true
        mode: ANNOTATED
        check-request-permission: false
        authorization-header: Authorization
        token-prefix: Bearer
        exclude-paths: []
Edit this page on GitHub
Last updated: 8/7/26, 8:33 AM
Previous
Sign-in and authorization example
Next
API reference