Skip to content

Unable to create domain #206

@hlassiege

Description

@hlassiege

Checklist

  • I am able to reproduce the bug with the latest version
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.

Affected version

1.1.1

Description of the problem

Hello,
I try to create a domain with the following code :

and then I get this error :

com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.lang.Long from String "68c8826046b6f0e2e109fe45": not a valid java.lang.Long value
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 7] (through reference chain: software.xdev.brevo.model.CreateDomainModel["id"])

indeed, the response was :

{"id":"68c8826046b6f0e2e109fe45","domain_name":"mydomain.com","domain_provider":"Hostinger","message":"Domain added successfully. To authenticate it, add following DNS records","dns_records":{"dkim1Record":{"type":"CNAME","value":"something","host_name":"something","status":false},"dkim2Record":{"type":"CNAME","value":"something","host_name":"something","status":false},"brevo_code":{"type":"TXT","value":"brevo-code:ce371b56ffc66bc6dc3c73e95cf8edb2","host_name":"@","status":false},"dmarc_record":{"type":"TXT","value":"v=DMARC1; p=none; rua=mailto:rua@dmarc.brevo.com","host_name":"_dmarc","status":true}}}

yet, the file https://github.com/xdev-software/brevo-java-client/blob/develop/brevo-java-client/src/generated/java/software/xdev/brevo/model/CreateDomainModel.java declare a Long instead of a String

However, it's true that the openapi definition is also wrong https://api.brevo.com/v3/swagger_definition_v3.yml

Even the dns records are wrong. dkim2Record is not defined in the openapi spec.

I can raise an issue to brevo if needed. But I don't know where to raise this issue.

createDomainModel:
      required:
      - id
      type: object
      properties:
        id:
          type: integer
          description: ID of the Domain created
          format: int64
          example: 5
        domain_name:
          type: string
          description: Domain
          example: example.com
        domain_provider:
          type: string
          description: Domain Provider
          example: GoDaddy
        message:
          type: string
          description: Success message
          example: Domain added successfully. To authenticate it, add following DNS records
        dns_records:
          type: object
          properties:
            dkim_record:
              type: object
              properties:
                type:
                  type: string
                value:
                  type: string
                host_name:
                  type: string
                status:
                  type: boolean
            brevo_code:
              type: object
              properties:
                type:
                  type: string
                value:
                  type: string
                host_name:
                  type: string
                status:
                  type: boolean
            dmarc_record:
              type: object
              properties:
                type:
                  type: string
                value:
                  type: string
                host_name:
                  type: string
                status:
                  type: boolean

Steps to reproduce the bug

Call CreateDomain

        val apiInstance = DomainsApi(brevoApiClient)
        val domainName = CreateDomain()
        domainName.name = domain
        val result = apiInstance.createDomain(domainName)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions