rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

How to get a generated endpoint URL #118

Closed Lifeclue closed 4 years ago

Lifeclue commented 4 years ago

Thanks Rapidoc. My API document became beautiful.

I have a wish one. I want to get an endpoint URL that it is generated automatically like this: 스크린샷 2020-01-22 오후 7 12 41

Are you have something way to get it? or should I PR?

mrin9 commented 4 years ago

I am not sure whats the request is, but if you looking for a way to provide a link to your API-Document's sections, then have a look at #113 and #80

check if they solve your problems. if you are looking for something else can you please provide a little more explanation if

Lifeclue commented 4 years ago

I'm sorry my poor English.

I trying to ask again in other words. I want to copy the endpoint URL easily. How about this:

function toggleExpand(path) {
  // The URL bar in the browser has the endpoint URL when I click the endpoint
  location.href = `${location.href.split('#')[0]}#${path.method}-${path.path.replace(/[\s#:?&=]/g, '-')}`;
  if (path.expanded) {
    path.expanded = false; // collapse
  } else {
    path.expanded = true; // Expand
  }
  this.requestUpdate();
}
mrin9 commented 4 years ago

oh I see, you would like to update the location.href as you visit various end-points. It is a good thing to do, and since you already did it in the above code, why dont you go ahead and do a PR and become a contributer in our project !

mrin9 commented 4 years ago

sorry closed by mistake

mrin9 commented 4 years ago

provided in release 7.1.1