yaml omitempty
erkylima opened this issue · comments
Érky Lima commented
I was using this library, but we have a problem and i can try to fix it, Anyone more have the problem that can't omit empty data? It's a great function that will improve this library a lot.
Érky Lima commented
It's a yaml generated with this library, but i wish omit the empty fields to reduce the file size. What do you think about that?
version: "3.7"
services:
- container_name: PHP
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: NodeJS
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: Go
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: Java
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: Python
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C++
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C#
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C++
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C#
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
- container_name: C
build:
context: ../
dockerfile: .devops/Dockerfile
volumes: []
ports: []
depends_on: []
environment: []
image: ""
networks:
- das
volumes:
- das
Izhak Jakov commented
Hi @erkylima
Could you please provide a sample code for generating a shorter version of the output in this comment?