Skip to content

Commit

Permalink
Merge pull request deegree#95 from lat-lon/serviceDoc-163-8876
Browse files Browse the repository at this point in the history
Fix link relation type to OpenAPI specification
  • Loading branch information
copierrj authored May 3, 2023
2 parents 5b83402 + 8faa8e5 commit 0b57e98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private void addConformance( List<Link> links, String conformanceHref ) {

private void addServiceDesc( List<Link> links, String apiHref ) {
links.add( new Link( apiHref, SERVICE_DESC.getRel(), APPLICATION_OPENAPI, "API definition" ) );
links.add( new Link( apiHref, SERVICE_DESC.getRel(), TEXT_HTML, "API definition as HTML" ) );
links.add( new Link( apiHref, SERVICE_DOC.getRel(), TEXT_HTML, "API definition as HTML" ) );
}

private void addData( List<Link> links, String collectionsHref ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h1 v-cloak class="mt-5">{{ title }}</h1>

this.title = json.title;
this.description = json.description;
this.apilink = firstByRel(json, 'service-desc');
this.apilink = firstByRel(json, 'service-doc');
this.collectionlink = firstByRel(json, 'data');
this.conformanceLink = firstByRel(json, 'conformance');
this.metadataLink = firstByRel(json, 'describedBy', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import static org.deegree.services.oaf.link.LinkRelation.DATA;
import static org.deegree.services.oaf.link.LinkRelation.SELF;
import static org.deegree.services.oaf.link.LinkRelation.SERVICE_DESC;
import static org.deegree.services.oaf.link.LinkRelation.SERVICE_DOC;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.xmlunit.matchers.HasXPathMatcher.hasXPath;
Expand Down Expand Up @@ -185,7 +186,7 @@ public void test_LandingPage_Links() {
assertThat( xml, hasXPath( linkWith( ALTERNATE, APPLICATION_XML ) ).withNamespaceContext( nsContext() ) );
assertThat( xml,
hasXPath( linkWith( SERVICE_DESC, APPLICATION_OPENAPI ) ).withNamespaceContext( nsContext() ) );
assertThat( xml, hasXPath( linkWith( SERVICE_DESC, TEXT_HTML ) ).withNamespaceContext( nsContext() ) );
assertThat( xml, hasXPath( linkWith( SERVICE_DOC, TEXT_HTML ) ).withNamespaceContext( nsContext() ) );
assertThat( xml, hasXPath( linkWith( CONFORMANCE, APPLICATION_JSON ) ).withNamespaceContext( nsContext() ) );
assertThat( xml, hasXPath( linkWith( CONFORMANCE, TEXT_HTML ) ).withNamespaceContext( nsContext() ) );
assertThat( xml, hasXPath( linkWith( CONFORMANCE, APPLICATION_XML ) ).withNamespaceContext( nsContext() ) );
Expand Down

0 comments on commit 0b57e98

Please sign in to comment.