Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve error nested mappings are not allowed in compact mappings

It says nested mappings are not allowed in compact mappings

eureka:
    client:
        register-with-eureka: false
        fetch-registry: false
        
        
server.port: 8796
  
  
spring.application.name: eurekaservice

After rewriting many times, it somehow stopped showing me error! Please some one say what would be the cause?

like image 905
Prajwal S M Avatar asked Dec 02 '25 05:12

Prajwal S M


2 Answers

check tabs and spaces. YAML expects indentations with spaces, not tabs. A lot of editors allow you to automatically convert tabs to spaces. It’s usually in the settings somewhere and you’ll want that switched on if you intend to tab-indent YAML.

like image 195
Adi Ep Avatar answered Dec 04 '25 03:12

Adi Ep


This can also happen if one or more of your values has a colon character (:), and the value(s) aren't wrapped in quotes.

like image 33
Steven Hirlston Avatar answered Dec 04 '25 03:12

Steven Hirlston



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!