Skip to content

Commit f603e63

Browse files
authored
Merge pull request #10 from statisticsnorway/hotfix/2.0.18
Hotfix/2.0.18
2 parents 9e3b99f + 3b8f296 commit f603e63

File tree

7 files changed

+36
-44
lines changed

7 files changed

+36
-44
lines changed

klass-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>no.ssb.klass</groupId>
1212
<artifactId>klass-root</artifactId>
13-
<version>2.0.17</version>
13+
<version>2.0.18</version>
1414
<!-- <relativePath>../</relativePath>-->
1515
</parent>
1616

klass-api/src/main/asciidoc/api-guide.adoc

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Klass API Guide
1+
= API guide to Statistical Classifications and Codelists (Klass)
22
:doctype: book
33
// :icons: font
44
:source-highlighter: highlightjs
@@ -19,7 +19,7 @@ This API requires you to use Percent-encoding for symbols and characters that ar
1919

2020
For more information on Percent-encoding see this https://en.wikipedia.org/wiki/Percent-encoding[wikipedia article]
2121

22-
You can also see it in use in the request example for <<presentationNamePattern, presentationNamePattern>>
22+
You can also see it in use in the request example for <<_presentationnamepattern, presentationNamePattern>>
2323

2424

2525
=== HTTP status codes
@@ -78,6 +78,7 @@ include::{snippets}/classifications-example/http-response.adoc[]
7878
===== Response structure
7979
include::{snippets}/classifications-example/response-fields.adoc[]
8080

81+
[[classifications-links]]
8182
===== Links
8283
include::{snippets}/classifications-example/links.adoc[]
8384

@@ -125,6 +126,7 @@ include::{snippets}/classification-example/http-response.adoc[]
125126
===== Response structure
126127
include::{snippets}/classification-example/response-fields.adoc[]
127128

129+
[[classification-links]]
128130
===== Links
129131
include::{snippets}/classification-example/links.adoc[]
130132

@@ -136,8 +138,8 @@ include::{snippets}/classification-optional-parameters-example/request-parameter
136138
Used to get codes from a classification. A range is specified when requesting the codes,
137139
and the response will for each code indicate its valid range (validFrom/validTo).
138140
The format and character set used, can be set in the http header (setting character set is only available for csv).
139-
For more information about the range see <<range, range>>. +
140-
To get a snapshot of codes valid at a specified date, use <<codesAt, codesAt>>
141+
For more information about the range see <<_range, range>>. +
142+
To get a snapshot of codes valid at a specified date, use <<_codesat, codesAt>>
141143

142144
===== Supported formats
143145
`text/csv`, `application/json`, `text/xml`
@@ -157,7 +159,6 @@ include::{snippets}/codes-example-json/http-response.adoc[]
157159
===== Request parameters
158160
include::{snippets}/codes-optional-parameters-example/request-parameters.adoc[]
159161

160-
[[codesAt]]
161162
=== codesAt
162163
Used to get codes from a classification. A date is specified when requesting the codes,
163164
and the response will include all codes valid at the specified date.
@@ -214,8 +215,9 @@ include::{snippets}/versions-example-csv/http-response.adoc[]
214215
Used to search codes from a classification variant. A range is specified when requesting the codes,
215216
and the response will for each code indicate its valid range (validFrom/validTo).
216217
The format and character set used, can be specified in the http header (character set is only available for csv).
217-
For more information about the range see <<range, range>>. +
218-
To get a snapshot of codes valid at a specified date, use <<variantAt, variantAt>>
218+
For more information about the range see <<_range, range>>. +
219+
To get a snapshot of codes valid at a specified date, use <<_variantaAt, variantAt>>.
220+
See also <<_variants_by_id, variants>>
219221

220222
===== Supported formats
221223
`text/csv`, `application/json`, `text/xml`
@@ -295,8 +297,8 @@ A range is specified when requesting the correspondence mappings,
295297
and the response will for each correspondence map indicate its valid range (validFrom/validTo).
296298
If a correspondence table is missing for parts of the range, the API will return 404 (not found).
297299
The format and character set used, can be specified in the http header (character set is only available for csv).
298-
For more information about the range see <<range, range>>. +
299-
To get a snapshot of correspondence mappings valid at a specified date, use <<correspondsAt, correspondsAt>>
300+
For more information about the range see <<_range, range>>. +
301+
To get a snapshot of correspondence mappings valid at a specified date, use <<_correspondsat, correspondsAt>>
300302

301303
===== Supported formats
302304
`text/csv`, `application/json`, `text/xml`
@@ -313,7 +315,6 @@ include::{snippets}/corresponds-example/http-response.adoc[]
313315
===== Request parameters
314316
include::{snippets}/corresponds-optional-parameters-example/request-parameters.adoc[]
315317

316-
317318
=== correspondsAt
318319
Used to get correspondence mappings between a source classification and a target classification.
319320
CorrespondsAt works only in the direction the correspondence table has been made. A switch of source and target, returns 404 (no correspondence table).
@@ -464,7 +465,6 @@ none
464465

465466

466467
== Request parameters
467-
[[range]]
468468
=== range
469469
A range is a time period with a `from` date and a `to` date. The dates are specified in format `<yyyy-MM-dd>`.
470470
`from` is inclusive and `to` is exclusive. `to` is optional, and if not specified the end of the range is considered to be indefinite.
@@ -480,15 +480,13 @@ If now increasing the range to also include 2014, it is seen that some codes are
480480
include::{snippets}/range-extended-example/curl-request.adoc[]
481481
include::{snippets}/range-extended-example/http-response.adoc[]
482482

483-
[[changedSince]]
484483
=== changedSince
485484
`changedSince` is used to find classifications that have been updated since a specified time.
486485
`changedSince` is specified in ISO 8601 DateTime format `<yyyy-MM-dd'T'HH:mm:ss.SSSZ>` e.g. "2015-10-31T01:30:00.000-0200"
487486

488487
===== Example
489488
include::{snippets}/changed-since-example/curl-request.adoc[]
490489

491-
[[selectCodes]]
492490
=== selectCodes
493491
`selectCodes` is used to limit the result to codes that match the pattern given by selectCodes. +
494492
`selectCodes` is a comma separated list of codes (may also use wildcard ' * ') +
@@ -511,7 +509,6 @@ include::{snippets}/select-codes-example-csv/curl-request.adoc[]
511509
include::{snippets}/select-codes-example-csv/http-response.adoc[]
512510

513511

514-
[[csvSeparator]]
515512
=== csvSeparator
516513
`csvSeparator` is used to specify separator to be used for csv format. Default is `,`
517514

@@ -520,7 +517,6 @@ include::{snippets}/csv-separator-example/curl-request.adoc[]
520517
===== Example response
521518
include::{snippets}/csv-separator-example/http-response.adoc[]
522519

523-
[[language]]
524520
=== language
525521
`language` is used to specify which language data shall be presented in. Default if none is selected is nb (Norwegian Bokmål).
526522

@@ -538,7 +534,6 @@ include::{snippets}/language-example/curl-request.adoc[]
538534
include::{snippets}/language-example/http-response.adoc[]
539535

540536

541-
[[selectLevel]]
542537
=== selectLevel
543538
`selectLevel` is used to limit result to codes that are at specified level
544539

@@ -548,7 +543,6 @@ include::{snippets}/select-level-example/curl-request.adoc[]
548543
include::{snippets}/select-level-example/http-response.adoc[]
549544

550545

551-
[[presentationNamePattern]]
552546
=== presentationNamePattern
553547
`presentationNamePattern` is used to build an alternative presentationName.
554548
To build a presentationName use curly braces to access other columns:
@@ -603,7 +597,6 @@ include::{snippets}/search-optional-parameters-example/http-response.adoc[]
603597

604598

605599
== Other
606-
[[page]]
607600
=== page
608601
When the response contains a collection of resources (e.g. classifications or searchResults).
609602
The response will limit the returned collection to a page of configurable size.

klass-api/src/test/java/no/ssb/klass/api/ApiDocumentation.java

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ public void classificationsExample() throws Exception {
229229
i -> createPage(i.getArgumentAt(2, Pageable.class), classifications));
230230
// @formatter:off
231231
this.mockMvc.perform(getWithContext("/classifications").accept(MediaType.APPLICATION_JSON))
232-
.andDo(this.documentationHandler.document(
233-
links(
232+
.andDo(this.documentationHandler.document(links(
234233
halLinks(),
235234
linkWithRel("self").description("The current request"),
236235
linkWithRel("search").description("Link to search for classifications")),
@@ -240,7 +239,7 @@ public void classificationsExample() throws Exception {
240239
fieldWithPath("_embedded.classifications[].lastModified").description("Last modification time of classification"),
241240
fieldWithPath("_embedded.classifications[]._links").description("Link to classification"),
242241
fieldWithPath("_links").description("<<classifications-links,Links>> to other resources"),
243-
fieldWithPath("page").description("Describes number of classifications returned, see <<page, page>>"))))
242+
fieldWithPath("page").description("Describes number of classifications returned, see <<_page, page>>"))))
244243
.andExpect(status().isOk());
245244
// @formatter:on
246245
}
@@ -277,7 +276,7 @@ public void searchExample() throws Exception {
277276
.description("Represents this classifications relevans for the search"),
278277
fieldWithPath("_embedded.searchResults[]._links").description("Link to classification that matched search"),
279278
fieldWithPath("_links").description("<<search-links,Links>> to other resources"),
280-
fieldWithPath("page").description("Describes number of classifications returned, see <<page, page>>"))))
279+
fieldWithPath("page").description("Describes number of classifications returned, see <<_page, page>>"))))
281280
.andExpect(status().isOk());
282281
// @formatter:on
283282
}
@@ -308,19 +307,19 @@ public void classificationExample() throws Exception {
308307
links(
309308
halLinks(),
310309
linkWithRel("self").description("The current request"),
311-
linkWithRel("codes").description("Used for getting codes from the classification, see <<Codes, codes>>"),
310+
linkWithRel("codes").description("Used for getting codes from the classification, see <<_codes, codes>>"),
312311
linkWithRel("codesAt")
313-
.description("Used for getting codes from the classification valid at a specific date, see <<CodesAt, codesAt>>"),
314-
linkWithRel("variant").description("Used for getting codes from a classification variant, see <<Variant, variant>>"),
312+
.description("Used for getting codes from the classification valid at a specific date, see <<_codesat, codesAt>>"),
313+
linkWithRel("variant").description("Used for getting codes from a classification variant, see <<_variant, variant>>"),
315314
linkWithRel("variantAt")
316315
.description("Used for getting codes from a variant of the classification valid at a specific date, "
317-
+ "see <<VariantAt, variantAt>>"),
316+
+ "see <<_variantat, variantAt>>"),
318317
linkWithRel("corresponds")
319-
.description("Used for getting mappings between two classifications, see <<Corresponds, corresponds>>"),
318+
.description("Used for getting mappings between two classifications, see <<_corresponds, corresponds>>"),
320319
linkWithRel("correspondsAt")
321320
.description("Used for getting mappings between two classifications at a specific date, "
322-
+ "see <<CorrespondsAt, correspondsAt>>"),
323-
linkWithRel("changes").description("Used for getting changes in codes, see <<Changes, changes>>")),
321+
+ "see <<_correspondsat, correspondsAt>>"),
322+
linkWithRel("changes").description("Used for getting changes in codes, see <<_changes, changes>>")),
324323
relaxedResponseFields(
325324
fieldWithPath("name").description("Classification name"),
326325
fieldWithPath("description").description("Description of classification"),
@@ -1068,23 +1067,23 @@ private ParameterDescriptor includeCodelistsDescription() {
10681067

10691068
private ParameterDescriptor languageDescription() {
10701069
return parameterWithName("language").description(
1071-
"[Optional] specifies language of retrieved data. Default is nb (Norwegian Bokmål). For details see <<language, language>>");
1070+
"[Optional] specifies language of retrieved data. Default is nb (Norwegian Bokmål). For details see <<_language, language>>");
10721071
}
10731072

10741073
private ParameterDescriptor changedSinceDescription() {
10751074
return parameterWithName("changedSince").description(
1076-
"[Optional] specifies that only classifications that have been changed since changedSince shall be included in the reponse." +
1077-
" For details see <<changedSince, changedSince>>");
1075+
"[Optional] specifies that only classifications that have been changed since changedSince shall be included in the response." +
1076+
" For details see <<_changedsince, changedSince>>");
10781077
}
10791078

10801079
private ParameterDescriptor fromParameterDescription() {
10811080
return parameterWithName("from").description(
1082-
"[Mandatory] specifies beginning of range with format `<yyyy-MM-dd>`. For details see <<range, range>>");
1081+
"[Mandatory] specifies beginning of range with format `<yyyy-MM-dd>`. For details see <<_range, range>>");
10831082
}
10841083

10851084
private ParameterDescriptor toParameterDescription() {
10861085
return parameterWithName("to").description("[Optional] specifies end of range with format `<yyyy-MM-dd>`. "
1087-
+ "If not set means that to is indefinite. For details see <<range, range>>");
1086+
+ "If not set means that to is indefinite. For details see <<_range, range>>");
10881087
}
10891088

10901089
private ParameterDescriptor dateParameterDescription() {
@@ -1101,27 +1100,27 @@ private ParameterDescriptor variantNameParameterDescription() {
11011100
return parameterWithName("variantName").description("[Mandatory] specifies name of classification variant\n\n"
11021101
+ "NOTE: If you want to look up codes from variants across multiple versions do not include the year "
11031102
+ "(or year month) and do not include everything after that\n\n"
1104-
+ "Ex. for `Particulate matter 2009 - Variant of substances emitted to air 2009` would be `Particulate matter`");
1103+
+ "Example for `Particulate matter 2009 - Variant of substances emitted to air 2009` would be `Particulate matter`");
11051104
}
11061105

11071106
private ParameterDescriptor csvSeparatorParameterDescription() {
11081107
return parameterWithName("csvSeparator").description(
1109-
"[Optional] specifies separator to be used for csv format. For details see <<csvSeparator, csvSeparator>>");
1108+
"[Optional] specifies separator to be used for csv format. For details see <<_csvseparator, csvSeparator>>");
11101109
}
11111110

11121111
private ParameterDescriptor selectCodesParameterDescription() {
11131112
return parameterWithName("selectCodes").description(
1114-
"[Optional] only return codes that match pattern given by selectCodes. For details see <<selectCodes, selectCodes>>");
1113+
"[Optional] only return codes that match pattern given by selectCodes. For details see <<_selectcodes, selectCodes>>");
11151114
}
11161115

11171116
private ParameterDescriptor selectLevelParameterDescription() {
11181117
return parameterWithName("selectLevel").description(
1119-
"[Optional] only return codes with matching level. For details see <<selectLevel, selectLevel>>");
1118+
"[Optional] only return codes with matching level. For details see <<_selectlevel, selectLevel>>");
11201119
}
11211120

11221121
private ParameterDescriptor presentationNamePatternParameterDescription() {
11231122
return parameterWithName("presentationNamePattern").description(
1124-
"[Optional] used to build a presentationName. For details see <<presentationNamePattern, presentationNamePattern>>");
1123+
"[Optional] used to build a presentationName. For details see <<_presentationnamepattern, presentationNamePattern>>");
11251124
}
11261125

11271126
private ParameterDescriptor ssbSectionParameterDescription(String part) {

klass-forvaltning/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>no.ssb.klass</groupId>
1616
<artifactId>klass-root</artifactId>
17-
<version>2.0.17</version>
17+
<version>2.0.18</version>
1818
<relativePath>../</relativePath>
1919
</parent>
2020

klass-shared/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>no.ssb.klass</groupId>
1313
<artifactId>klass-root</artifactId>
14-
<version>2.0.17</version>
14+
<version>2.0.18</version>
1515
</parent>
1616

1717
<properties>

klass-solr/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>no.ssb.klass</groupId>
1515
<artifactId>klass-root</artifactId>
16-
<version>2.0.17</version>
16+
<version>2.0.18</version>
1717
</parent>
1818

1919
<dependencies>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>no.ssb.klass</groupId>
66
<artifactId>klass-root</artifactId>
7-
<version>2.0.17</version>
7+
<version>2.0.18</version>
88
<packaging>pom</packaging>
99

1010
<parent>

0 commit comments

Comments
 (0)