[SERVER-73587] IDL 'chained_structs' does not execute the 'cpp_validator_func' of the struct linked in Created: 03/Feb/23  Updated: 09/Feb/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-73492 Support IDL 'type' under 'server_para... Open
Assigned Teams:
Service Arch
Participants:

 Description   

I'm trying to get a command to run a 'cpp_validator_func'. Similar to SERVER-73492, 'commands' doesn't recognize 'cpp_validator_func'

text_search_index_commands.idl: (110, 8): ID0008: Unknown IDL node 'cpp_validator_func' for YAML entity 'command'

So I tried using the 'chained_structs' field to link in a 'structs' type that does accept 'cpp_validator_func'. But while using 'chained_structs' in the command and 'cpp_validator_func' in the struct compiles, the validator function doesn't get run.

For example, I want to convert this IDL command that doesn't accept 'cpp_validator_func'

commands:
    updateSearchIndex:
        description: "Command to update a search index."
        command_name: updateSearchIndex
        namespace: concatenate_with_db
        cpp_name: UpdateSearchIndexCommand
        strict: true
        reply_type: UpdateSearchIndexReply
        fields:
            name:
                description: "The name of the index to be updated"
                type: string
                optional: true
                stability: stable
        api_version: ""

Into a command + struct w/ validator like this:

structs:
    UpdateSearchIndexRequest:
        description: "todo"
        strict: true
        cpp_validator_func: "validateUpdateSearchIndexRequest"
        fields:
            name:
                description: "The name of the index to be updated"
                type: string
                optional: true
                stability: stable
 
commands:
    updateSearchIndex:
        description: "Command to update a search index."
        command_name: updateSearchIndex
        namespace: concatenate_with_db
        cpp_name: UpdateSearchIndexCommand
        strict: true
        reply_type: UpdateSearchIndexReply
        inline_chained_structs: true
        chained_structs:
            UpdateSearchIndexRequest: UpdateSearchIndexRequest
        api_version: ""


Generated at Thu Feb 08 06:25:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.