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.

Key of an element should be exposed in the element

See original GitHub issue

Originally posted as Question 2 in https://github.com/eclipse/microprofile-open-api/issues/234


When you work a lot with the model classes, for each member of a map (like PathItem element in the Paths object), you need to transport the key and the value everywhere because the information you need in contained in Entry<String, PathItem>.

Example:

void printOperationsInfo(String path, PathItem path);

Or to have your own holder class:

static class PathItemWithPath {
    final String pathString;
    final PathItem path;

    public PathItemWithPath(final String pathString, final PathItem path) {
        super();
        this.pathString = pathString;
        this.path = path;
    }

The Kaizen-Parser Model did solve this with:

	String getPathString();

(source)

Maybe the wording is not ideal, @arthurdm pointed that the API needs to be consistent. PathItems are added with addPathItem(String, PathItem):

https://github.com/eclipse/microprofile-open-api/blob/8e0f2479a00470911d64ae13a59c5cd78f4240c9/api/src/main/java/org/eclipse/microprofile/openapi/models/Paths.java#L34-L41

So the getter for the key in the owner map in PathItem should be called getName().


This issue needs further discussion and checks. Other requirement having switched to immutable maps (see #240).

Then we can add also TCK tests that ensure that when you mutate a map the exposed key is also updated.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
arthurdmcommented, Nov 15, 2018

that sounds ok with me. @jmini - if you wanted to do the revert, I am fine with this only going into 2.0.

1reaction
wojtczatcommented, Oct 11, 2018

@arthurdm I’ll work on this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML elements reference - HTML: HyperText Markup Language
This page lists all the HTML elements, which are created using tags. They are grouped by function to help you find what you...
Read more >
ReactJS : What is the best way to give keys in array element
The best way to pick a key is to use a string that uniquely identifies a list item among its siblings. Most often...
Read more >
Key Sequences - Mallard
The keyseq element can occur in any general inline context, including inside most inline elements, some basic block elements, and certain informational elements...
Read more >
7 User Interaction — HTML 5 - W3C
User agents may expose elements that have an accesskey attribute in other ways as well, e.g. in a menu displayed in response to...
Read more >
Key Elements of an Exposure Control Plan - Chemscape
Learn about all the elements of exposure control plans to ensure the safety of your workplace from chemical hazards.
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