Skip to content

Commit

Permalink
fix(specs): types and parameters (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Jun 20, 2022
1 parent 937c5a6 commit c917710
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ private IJsonSchemaValidationProperties findMatchingOneOf(Object param, CodegenM
}
}
for (CodegenModel oneOf : model.interfaceModels) {
if (oneOf.dataType.equals(paramType)) return oneOf;
// Somehow the dataType can be in lower case?
if (oneOf.dataType.toLowerCase().equals(paramType.toLowerCase())) {
return oneOf;
}
}
return null;
}
Expand Down
64 changes: 44 additions & 20 deletions specs/common/schemas/IndexSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ baseIndexSettings:
type: string
description: Sets the languages at the index level for language-specific processing such as tokenization and normalization.
default: []
filterPromotes:
type: boolean
description: Whether promoted results should match the filters of the current search, except for geographic filters.
default: false
disablePrefixOnAttributes:
type: array
items:
Expand All @@ -65,19 +61,23 @@ baseIndexSettings:
type: string
description: List of numeric attributes that can be used as numerical filters.
default: []
separatorsToIndex:
type: string
description: Control which separators are indexed.
default: ''
searchableAttributes:
type: array
items:
type: string
description: The complete list of attributes used for searching.
default: []
userData:
$ref: '#/userData'

indexSettingsAsSearchParams:
type: object
additionalProperties: false
properties:
searchableAttributes:
type: array
items:
type: string
description: The complete list of attributes used for searching.
default: []
attributesForFaceting:
type: array
items:
Expand Down Expand Up @@ -175,18 +175,10 @@ indexSettingsAsSearchParams:
type: string
description: List of attributes on which you want to disable typo tolerance.
default: []
separatorsToIndex:
type: string
description: Control which separators are indexed.
default: ''
ignorePlurals:
type: string
description: Treats singular, plurals, and other forms of declensions as matching terms.
default: false
$ref: '#/ignorePlurals'
removeStopWords:
type: string
description: Removes stop (common) words from the query before executing it.
default: false
$ref: '#/removeStopWords'
keepDiacriticsOnCharacters:
type: string
description: List of characters that the engine shouldn't automatically normalize.
Expand Down Expand Up @@ -327,3 +319,35 @@ alternativesAsExact:
advancedSyntaxFeatures:
type: string
enum: [exactPhrase, excludeWords]

ignorePlurals:
description: >
Treats singular, plurals, and other forms of declensions as matching terms.
ignorePlurals is used in conjunction with the queryLanguages setting.
list: language ISO codes for which ignoring plurals should be enabled. This list will override any values that you may have set in queryLanguages.
true: enables the ignore plurals functionality, where singulars and plurals are considered equivalent (foot = feet). The languages supported here are either every language (this is the default, see list of languages below), or those set by queryLanguages.
false: disables ignore plurals, where singulars and plurals are not considered the same for matching purposes (foot will not find feet).
oneOf:
- type: array
items:
type: string
- type: boolean
default: false

removeStopWords:
description: >
Removes stop (common) words from the query before executing it.
removeStopWords is used in conjunction with the queryLanguages setting.
list: language ISO codes for which ignoring plurals should be enabled. This list will override any values that you may have set in queryLanguages.
true: enables the stop word functionality, ensuring that stop words are removed from consideration in a search. The languages supported here are either every language, or those set by queryLanguages.
false: disables stop word functionality, allowing stop words to be taken into account in a search.
oneOf:
- type: array
items:
type: string
- type: boolean
default: false
2 changes: 2 additions & 0 deletions specs/common/schemas/SearchParams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ baseSearchParams:
type: array
items:
type: number
format: double
description: Search inside a rectangular area (in geo coordinates).
insidePolygon:
type: array
items:
type: number
format: double
description: Search inside a polygon (in geo coordinates).
naturalLanguages:
type: array
Expand Down
3 changes: 3 additions & 0 deletions specs/predict/paths/fetchUserProfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ post:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
lastUpdatedAt:
Expand All @@ -53,6 +54,7 @@ post:
properties:
value:
type: number
format: double
minimum: 0
lastUpdatedAt:
type: string
Expand All @@ -72,6 +74,7 @@ post:
type: string
probability:
type: number
format: double
minimum: 0
maximum: 1
lastUpdatedAt:
Expand Down
9 changes: 6 additions & 3 deletions specs/search/common/schemas/SearchQuery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ searchForFacetsOptions:
indexName:
$ref: '../../../common/parameters.yml#/indexName'
facetQuery:
type: string
description: Text to search inside the facet's values.
default: ''
$ref: '#/facetQuery'
maxFacetHits:
$ref: '../../../common/schemas/IndexSettings.yml#/maxFacetHits'
type:
Expand All @@ -34,6 +32,11 @@ searchForFacetsOptions:
- type
- facet

facetQuery:
type: string
description: Text to search inside the facet's values.
default: ''

searchForHitsOptions:
# We provide this option because TypeScript can't distinguish union with optional keys
# if they are not completely the same, see usage in `templates/javascript/model.mustache`
Expand Down
4 changes: 1 addition & 3 deletions specs/search/paths/search/searchForFacetValues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ post:
params:
$ref: '../../../common/schemas/SearchParams.yml#/paramsAsString'
facetQuery:
type: string
description: Text to search inside the facet's values.
default: ''
$ref: '../../common/schemas/SearchQuery.yml#/facetQuery'
maxFacetHits:
$ref: '../../../common/schemas/IndexSettings.yml#/maxFacetHits'
responses:
Expand Down
1 change: 1 addition & 0 deletions templates/java/oneof_interface.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.List;

@JsonAdapter({{classname}}.Adapter.class)
{{>additionalModelTypeAnnotations}}
Expand Down
Loading

0 comments on commit c917710

Please sign in to comment.