This article will explain how to make a diagram from a Web Service Schema collapsible - this is useful if you have very large diagrams and want to avoid a vertical scrollbar - so that a user does not have to scroll through. To achieve this you need to create a custom template.
You can find out how to create a custom template here:
https://innovasys.zendesk.com/hc/en-gb/articles/360000765543-Creating-A-Custom-Template
In this case, the relevant base Template is the Classic Web Service Documentation. Once the Template has been created and is open for edit, you need to navigate to the Scraps page in the Template Editor and find the _REQUEST_LIST_BODY and _SUCCESS_RESPONSE_LIST_BODY files. You then have to click the Edit button at the top which will open the Editor for the scrap you have selected. You need to make the following changes:
Change _REQUEST_LIST_BODY to:
%%replaceinquotes:value=false%%%%scrap:name=_COLLAPSIBLE_HEADER,idprefix="request_%%RequestNameScriptSafe%%",caption="REQUEST_BODY %%replaceinquotes:value=false%%%%RequestName:format="" (%%RequestName%%)""%%"%%<p>%%RawDataType:format="%%Phrase:name=REQUEST_BODY_DATATYPE_INTRO%%"%%</p>%%description:format="<div>%%description%%</div>"%%%%filtereditemlist:namespace="Parameter",scrap="_PARAMETER_LIST",filter="type=!header",format="<h3>REQUEST_BODY_PARAMETERS</h3>%%filtereditemlist%%"%%%%filtereditemlist:namespace="Parameter",scrap="_HEADER_LIST",filter="type=header",format="<h3>REQUEST_HEADERS</h3>%%filtereditemlist%%"%% %%replaceinquotes:value=false%%%%RequestBodyDiagram:format="%%scrap:name=_COLLAPSIBLE_HEADER,idprefix=RequestDiagram,caption=Request Body Diagram%%%%RequestBodyDiagram%%</div>"%% %%RequestBodyOverview:format="<h3>Overview</h3>%%RequestBodyOverview%%"%%%%SampleData:format="<h3>Sample_Data</h3>%%SampleData%%"%%</div>
and _SUCCESS_RESPONSE_LIST_BODY to:
%%replaceinquotes:value=false%%%%scrap:name=_COLLAPSIBLE_HEADER,idprefix="response_%%ResponseNameScriptSafe%%",caption="RESPONSE_BODY %%replaceinquotes:value=false%%%%ResponseName:format="" (%%ResponseName%%)""%%"%%<p>%%RawDataType:format="%%Phrase:name=RESPONSE_BODY_DATATYPE_INTRO%%"%%</p>%%description%%%%filtereditemlist:namespace="Parameter",scrap="_PARAMETER_LIST",filter="type=!header",format="<h3>REPONSE_BODY_PARAMETERS</h3>%%filtereditemlist%%"%%%%filtereditemlist:namespace="Parameter",scrap="_HEADER_LIST",filter="type=header",format="<h3>REPONSE_HEADERS</h3>%%filtereditemlist%%"%% %%replaceinquotes:value=false%%%%ResponseBodyDiagram:format="%%scrap:name=_COLLAPSIBLE_HEADER,idprefix=ResponseDiagram,caption=Response Body Diagram%%%%ResponseBodyDiagram%%</div>"%% %%ResponseBodyOverview:format="<h3>Overview</h3>%%ResponseBodyOverview%%"%%%%SampleData:format="<h3>Sample_Data</h3>%%SampleData%%"%%</div>
This surrounds the diagram in the response and request sections with a collapsible header. You will finally need to make sure you are using these templates in your build profile - to do you need to right click your build profile, select edit. Then in the Build Profile Editor that appears, navigate to Templates. Finally, you must select your Custom template from the Web Service Documentation drop-down box. Your diagrams should now look like this after rebuilding:
0 Comments