question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify Extensible name (with/without x-)

See original GitHub issue

The javadoc of Extensible.addExtension states:

@param name the key used to access the extension object. Always prefixed by "x-".

This can be understood in two ways:

  1. The name passed is plain and the extensible object will prefix it with x- in its map.
  2. The name should start with x-. Does this mean other should be ignored?

In the TCK examples the annotations use names with the x- prefix already in the name. I’d think that from the user perspective these should be plain names without the x- as it is more readable and avoids using illegal names by design.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
EricWittmanncommented, Apr 1, 2019

We reviewed this issue in the MP hangout last week. The consensus was that we would not do any automatic conversion of non x- to x- extension names. However, we will ensure that the javadoc appropriately describes the requirements of using the @Extension annotation - specifically that the names of all extensions MUST begin with a x- or else an invalid document will be potentially created.

We have two main reasons for this.

  1. Any consumers of the extension properties will need to refer to those properties with their proper x- prefixed names, so it would be weird to define them in @Extension without the prefix.
  2. There are many ways to produce an invalid OpenAPI document using annotations, and it would be very difficult (perhaps impossible) for the platform implementation to check for every possible way in which the developer might mess up.

The best solution for this problem is for the platform to support validation of the resulting OpenAPI document. Optional validation support is something we will be adding to the MP+OAI spec in the near future.

0reactions
jbeecommented, Mar 8, 2022

There are many ways to produce an invalid OpenAPI document using annotations, and it would be very difficult (perhaps impossible) for the platform implementation to check for every possible way in which the developer might mess up.

With the same logic you could argue that static types in a language are “not needed” as developers have many ways (e.g. casts) to produce an invalid program. Why even have the compiler check it since there are many ways mess up, right?. Just saying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference Manual for X-13ARIMA-SEATS - Census.gov
C Irregular-Component Regression Models in X-13ARIMA-SEATS ... created a file named path\filename.html as an output file. ... To explain why this.
Read more >
What is the Hyper-V Virtual Switch and how does it work?
The Hyper-V virtual switch is the first step to getting your VM on the network, here's all you need to know about planning...
Read more >
RFC 1000 - Request For Comments reference guide
File Transfer Protocol 987 - Mapping Between X.400 and RFC 822 959, 542, ... on a TIP 229 - Standard Host Names 228...
Read more >
Using Prolog for Transforming XML Documents - arXiv
and its distinction is high expressibility and extensibility. XPath is a “sub”-language of XSLT and ... if the actual node $X has an...
Read more >
Available CRAN Packages By Name
BlockmodelingGUI, GUI for the Generalised Blockmodeling of Valued Networks ... EnsembleBase, Extensible Package for Parallel, Batch Training of Base ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found