Skip to content

[Bug]POST /v1/devices API Fails to Reject SN Codes Containing Chinese Characters #3

@Unmeiwa

Description

@Unmeiwa

Description

When sending a serial number (SN) containing Chinese characters through the API to the server, the system does not perform effective validation or restrictions, allowing unexpected character sets to be accepted.

Steps to Reproduce

Steps to reproduce the behavior:
1.Open an API testing tool (e.g., Postman).
2.Construct a request body with a SN code containing Chinese characters, for example: "sn": "SN202501是2002".
3.Send a POST request to the specified API endpoint.

Actual Behavior

The server accepts the SN code containing Chinese characters and successfully creates the device record.

Expected Behavior

The system should reject SN codes containing non-alphanumeric characters, or at least specify the supported character set in the API documentation.

Environment (if applicable)

Additional Context

The screenshot shows that the SN code containing Chinese characters was successfully accepted.
The API documentation does not specify any restrictions on the character set for the SN code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions