Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-73587

IDL 'chained_structs' does not execute the 'cpp_validator_func' of the struct linked in

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch

    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: ""
      

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: