ocket8888 commented on code in PR #7023:
URL: https://github.com/apache/trafficcontrol/pull/7023#discussion_r949363613
##########
docs/source/api/v4/servers.rst:
##########
@@ -69,6 +69,10 @@ Request Structure
| | | the first page is 1. If ``offset`` was
defined, this query parameter has no effect. ``limit`` must be defined to |
| | | make use of ``page``.
|
+----------------+----------+-------------------------------------------------------------------------------------------------------------------+
+ | asn | no | Return only the servers that have a
cachegroup matching the provided ASN. |
+ | | | .. versionadded:: 4.1
|
Review Comment:
The indentation here is subtle and easy to miss. There's a tab character
before the `.. versionadded::` directive that causes it to be a block indented
beneath the text above. This causes it to render as a list of terms and
definitions. The way this markup is written causes Sphinx to believe that the
content of this cell is the term "Return only the servers that have a
cachegroup matching the provided ASN" and the definition of that term is that
something is new in version 4.1. In HTML it looks like this:
```html
<!-- the rest of the table -->
<td>
<dl>
<dt>Return only the servers that have a cachegroup matching the provided
ASN.</dt>
<dd><span class="versionchanged added">New in version 4.1.</span></dd>
</dl>
</td>
<!-- the rest of the document -->
```
If you remove the tab character, though, it considers that to be nothing
more than a continuation of the above paragraph and renders the text `..
versionadded:: 4.1` literally, which is why I suspect you added the tab in the
first place.
Instead, just put a blank line between the directive and the rest of the
text, and it'll render how you want it to: as a regular paragraph followed by a
directive indicating the version at which something was added.
##########
lib/go-tc/servers.go:
##########
@@ -1019,6 +1021,12 @@ func UpdateServerPropertiesV40(profileNames []string,
properties CommonServerPro
}
}
+// ServerV41 is the representation of a Server in version 4.1 of the Traffic
Ops API.
+type ServerV41 struct {
+ ServerV40
+ ASNs pq.Int32Array `json:"asns"`
Review Comment:
While I'm here I just want to mention that this should probably just be a
`[]int` and you wrap the reference to the property with `pq.Int32Array` for
scanning purposes. Makes consumption of the API much simpler.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]