Skip to content

Ignoring port value in the spring rest doc snippets #325

@JananiSubbiah

Description

@JananiSubbiah

I am generating spring rest docs using mock mvc and I see that my doc always contains a port value (its either 8080 if I do not override it with a custom one or its the custom port value I provide). I am not sure if this is possible but I was looking for a way to omit the port from my request and response (in the snippets particularly).
For example my curl-request.adoc looks like this (I have set no port value)

[source,bash]
----
$ curl 'https://mylocalhost:8080/myapp' -i
----

and the @before method in my junit looks like this:

this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context).apply(documentationConfiguration(this.restDocumentation).uris().withScheme("https").withHost("mylocalhost")).build();

Is it possible for the curl-request.adoc to look as follows without the port?

[source,bash]
----
$ curl 'https://mylocalhost/myapp' -i
----

Thanks for any help in this regard!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions