hapi-server / uri-templates

Repository of tools for URI templates
Apache License 2.0
2 stars 0 forks source link

Consider adding $N which would help with documentation #6

Open jbfaden opened 3 years ago

jbfaden commented 3 years ago

I'd like for us to consider allowing $N to be the equivalent of $(subsec,places=9). Note Linux's date command uses it, so it follows that precedent, and it gives a one-letter name for the place in code. For example, I have a 7-element array I use to pass around times, and I can name each place with a one-character label Y, h, m, H, M, S, but not the last one, which I call nanos. I think it would be useful to have this, and it would be a trivial extension of the spec.

jbfaden commented 3 years ago

Here's an example Javadoc: /**

rweigel commented 3 years ago

I agree with this addition in principle. For clarity, would you describe a unit test that would go into the formatting.json file? I don't see a subsec example there and use this file more than the actual spect to understand the notation.

jbfaden commented 3 years ago

I was just looking at those tests. I can put one in for subsec... Also note I added "id" which is to be a unique identifier for each test.

jbfaden commented 3 years ago

I noticed that we do have $N reserved for future use (this use).

jbfaden commented 2 years ago

I'd like to proceed with this change if there are no objections.