Here is the quote from https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-application-property-files
If you use environment variables rather than system properties, most operating systems disallow period-separated key names, but you can use underscores instead (for example, spring.config.name instead of spring.config.name).
I suppose it should be spring_config_name
.
I wasn't really sure how to do this so I created an issue anyways. Guide me for the future so I don't create useless issues.
Comment From: philwebb
I wasn't really sure how to do this so I created an issue anyways. Guide me for the future so I don't create useless issues.
This is the correct place to raise issues like this. It's certainly not a useless issue, so thanks for raising it!
Comment From: philwebb
Looks like this is an issue with out asciidoc macro.
Comment From: philwebb
Oddly this only appears in the /html
output, /htmlsingle
is fine.
Comment From: wilkinsona
This comment from @mojavelinux seems relevant to our problem, specifically this part:
When the format is long, the attributes are parsed if the content model is ":attributes". If the content model is ":text", then the value between the brackets is stored in the "text" attribute. In other words, when the format is long, the attributes map is always populated. But the attributes aren't parsed unless the content model is ":attributes" (the default).
It's from 2016, but assuming things are still the same, it would suggest that when the multi-page documentation is being rendered, the content model is :text
but when the single-page documentation is being rendered it's :attributes
.
Comment From: wilkinsona
I think I may have a fix for this: https://github.com/spring-io/spring-asciidoctor-extensions/issues/51
Comment From: wilkinsona
I'm not sure that I do. When generating the single-page documentation, the macro processor sees this:
Attributes: {format=envvar}
Config: {content_model=attributes}
When generating the multi-page documentation, the macro processor sees this:
Attributes: {text=format=envvar}
Config: {content_model=attributes}
The config is identical in both cases.
Comment From: wilkinsona
It seems to be a problem with the multipage support. If I include spring-boot-features.adoc
on its own the problem disappears. Including a second file then breaks things again with the processing of the first file seeing attributes in the expected format and processing of the second file seeing the text=
problem.
These two files are enough to reproduce the problem:
[[using-boot]]
= Using Spring Boot
configprop:server.port[format=envvar]
[[boot-features]]
= Spring Boot Features
configprop:server.port[format=envvar]
The format works in the first file but does not work in the second. The problem also occurs if the first file doesn't use the macro at all.
Comment From: wilkinsona
This appears to be a regression in AsciidoctorJ. The problem goes away when downgrading to 2.0. I've opened https://github.com/asciidoctor/asciidoctorj/issues/926. We'll need to work around the problem in the extension by looking for a format
key with a value of envvar
and text
key with a value of format=envvar
.