Closed minarc closed 3 years ago
@minarc These type structs are generated from the OpenAPI spec here.
Can you please update the YAML spec and regenerate the types using oapi-codegen? You can see the commands to generate the autogenerated code here: https://github.com/typesense/typesense-go/blob/master/typesense/api/doc.go or just use go generate ./...
Thank you for your advice @v-byte-cpu
Going forward, the plan is to keep the open API spec updated here:
https://github.com/typesense/typesense-api-spec/blob/master/openapi.yml
@shivag46 has helped in making one round of updates to it, but it seems to be missing search_time_ms
and text_match
.
@kishorenc I think typesense changed 'took_ms' to 'search_time_ms' from some version update.
Going forward, the plan is to keep the open API spec updated here:
https://github.com/typesense/typesense-api-spec/blob/master/openapi.yml
@shivag46 has helped in making one round of updates to it, but it seems to be missing
search_time_ms
andtext_match
.
I guess I missed those fields. Will add them
Oh right took_ms
was changed a while back. So we need to replace took_ms
with search_time_ms
and then also add text_match
@shivag46.
Oh right
took_ms
was changed a while back. So we need to replacetook_ms
withsearch_time_ms
and then also addtext_match
@shivag46.
Sure! I will do that
Going forward, the plan is to keep the open API spec updated here:
https://github.com/typesense/typesense-api-spec/blob/master/openapi.yml
@kishorenc openapi.yml file is part of the project source code, and it must be in this repository for successful code generation (regardless of the life cycle of https://github.com/typesense/typesense-api-spec repository). Moreover, there were difficulties in unifying the openapi.yml file https://github.com/typesense/typesense-go/issues/70, so it is not possible now to reuse a shared file without modification.
openapi.yml file is part of the project source code, and it must be in this repository for successful code
👍
so it is not possible now to reuse a shared file without modification.
I presume that re-generating the Go client with the updated YML spec (with wrapper objects) would cause widespread changes? Here is the diff between the two versions: https://www.diffchecker.com/cVqE4Clr
I wonder if it will help in the longer run to just release a new version of the Go client with the structs with wrapper objects for the search params. This will ensure that we don't have to maintain 2 versions of the YML spec, even if a copy of the YML spec is also kept in the go lang repo. Happy to help with the migration -- please let me know what you think.
@minarc I guess you also forgot to add the text_match
field to the openapi.yml file
Change Summary
update typesense version to 0.21.0 and add the fields 'text_match' and fix the 'took_ms' to 'search_time_ms'
PR Checklist