Skip to content

Conversation

@BigBlueHat
Copy link
Member

@BigBlueHat BigBlueHat commented Nov 24, 2025

  • Add comments to sections; helps while editing.
  • Add RenderMethod section; move nfc there.

This is an attempt to address #37 and uses ideas from #32 which could be expanded to the other render method definitions.


Preview | Diff

This is especially useful when folding/collapsing sections in an editor
that supports that.
This also introduces the concept of `modality` which may be useful for
other types of render methods.
@BigBlueHat BigBlueHat requested a review from bparth24 November 24, 2025 20:12
@BigBlueHat BigBlueHat changed the title untemplated methods Introduce RenderMethod for untemplated renderings. Nov 24, 2025
Copy link

@bparth24 bparth24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BigBlueHat cc: @dlongley

LGTM at first read.

Additionally, I feel we still need to update nfc example 8 in here https://pr-preview.s3.amazonaws.com/w3c/vc-render-method/pull/38.html#example-usage-of-the-nfc-render-suite - replace payload with template as field name.

Payload name is only for legacy support and should not be used for any new NFC development work. Template field name should be used IIRC from the slack conversation between you, me and Dave Longley.

index.html Outdated
Comment on lines 604 to 608
<h4>RenderMethod</h4>

<p>
In situations where templating is not required, an [=issuer=] can provide a
predetermined payload to be displayed, transmitted, or otherwise rendered.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use what could be the base class for all render methods for this -- specifically because of the payload property, which I'll explain more on below. If we want to do this, we ought to use another name. Maybe PayloadRenderMethod or StaticRenderMethod?

I think it does make sense to define a base class (probably named RenderMethod) for all render methods, but it should only include those properties that are expected to be available/used (and not in conflict) with any derived classes. If we include payload as a property on the base class, it will be in conflict with TemplateRenderMethod which not only does not use it, but uses something else for a similar purpose: template.

Notably, the value of template could already potentially be used to produce a "static" output, which would cover the payload case without the need for yet another render method. We should discuss and decide whether it's worth having a render method just for a single special case of templating.

Presumably, there's some performance benefit to not running a template through a template engine when this is the case. However, I expect that to probably be a fairly minor benefit -- especially when weighed against the aggregate cost of every rendering application in the ecosystem needing to implement a different bit of code for a special case (and the testing, test suite, etc., required).

Also, TemplateRenderMethod may still produce a "static" output anyway even after this. Certainly, IMO, creating an error case and trying to detect whether a template "changed" in its output (and should have been SomethingElseRenderMethod on that basis) is not a good use of effort or resources.

I think many of the properties below make sense to go into a base class: description, name, id, type, modality, etc. I also wonder whether renderProperty should be in the base class. The renderProperty is a declaration by the issuer of what information from the VC will be present in the rendering. This has utility for rendering software regardless of whether the output of filtering a VC (via this property) is used in the output directly or just implicitly.

Copy link

@dlongley dlongley Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way to do "static" rendering is to use TemplateRenderMethod and specify the template engine as static (as opposed to mustache or whatever else), and specify the template with an appropriate media type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably, there's some performance benefit to not running a template through a template engine when this is the case.

I think there's also a security consideration here as authors may want to avoid the contents being passed to other processors, and so are providing something with no additional processing expectations.

I agree that RenderMethod can (and probably should be a base class that TemplateRenderMethod extends with templating functionality) and ideally the additional "content" term (i.e. payload or template or whatever) is inherited as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, TemplateRenderMethod may still produce a "static" output anyway even after this. Certainly, IMO, creating an error case and trying to detect whether a template "changed" in its output (and should have been SomethingElseRenderMethod on that basis) is not a good use of effort or resources.

Not suggesting that at all, just that the author of the credential should have a way to express that they do not want this processed only displayed which the overloading of the template term would not allow--without additional signals as you mention with static as a template engine option.

Either way, authors of credentials should be empowered to provide inert values for display/use (as with the nfc use case).

Useful for signaling what is to be shared via the render method.
The goal is to have a single term for both static and pre-processed content
provided in the render method.
@dmitrizagidulin
Copy link
Collaborator

Additionally, I feel we still need to update nfc example 8 in here https://pr-preview.s3.amazonaws.com/w3c/vc-render-method/pull/38.html#example-usage-of-the-nfc-render-suite - replace payload with template as field name.

I agree, I think the field containing the template should be termed template -- payload is a bit confusing.

Copy link
Collaborator

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. (payload field should be renamed to template if at all possible, though.)

<td>
A REQUIRED [=string=] that identifies the algorithms that are used for
generating the concrete rendering.
A REQUIRED [=string=] that identifies the mode by which the payload will be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make more sense to make this field OPTIONAL. (or, if missing, default to the value default or something similar)

</section>

<section>
<section><!-- pdf-mustache Render Suite -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the pdf-mustache section. PDF is a binary format, it's not really possible to use Mustache with it.

@dmitrizagidulin
Copy link
Collaborator

Discussed during Wed Dec 3, 2025 call.

  • Manu mentioned that we need to be careful about the VC 2.0 Vocab being frozen (and it defines a TemplateRenderMethod class already).
    • also, the consensus at VC WG was "we're not going to substantiate the 'abstract' classes" -- do we want to go a different path instead? The alternative would be to create two new subclasses, Templated and Un-Templated.
  • Dave: It seems that we've come up with a handful of properties that would be useful for many suites (name, description, modality, renderProperty, a payload/template field, and renderSuite). Which means we don't have to mess with the abstract superclass method.
  • Benjamin: re 'pdf-template' suite -- we don't need a separate type for that, the pdf part can just be handled in the suite media type.

Consensus so far:

  1. Leave the abstract class as is, in the vocab (RenderMethod)
  2. Create (just one to start with) subclass (name tbd)
  3. Switch the rendering logic, as much as possible, through the suite name.

Lets refactor this PR and re-discuss.

A REQUIRED [=string=] that identifies the algorithms that are used for
generating the concrete rendering.
A REQUIRED [=string=] that identifies the mode by which the payload will be
transmitted or rendered. Possible examples of modalities may include `nfc`,
Copy link
Member

@TallTed TallTed Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible, examples, and may are redundant.

Suggested change
transmitted or rendered. Possible examples of modalities may include `nfc`,
transmitted or rendered. Possible modalities include `nfc`,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or

Suggested change
transmitted or rendered. Possible examples of modalities may include `nfc`,
transmitted or rendered. Example modalities include `nfc`,


<pre class="example nohighlight"
title="Usage of the render property by an issuer">
title="Usage of the nfc render suite">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title="Usage of the nfc render suite">
title="Use of the NFC render suite">

</table>

<pre class="example nohighlight"
title="Usage of the renderSuite property by an issuer">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title="Usage of the renderSuite property by an issuer">
title="Use of the renderSuite property by an issuer">

@bparth24 bparth24 self-requested a review December 4, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants