eclipse-uprotocol / up-cpp

uProtocol Language Specific Library for C++
Apache License 2.0
15 stars 24 forks source link

Uri Validator IsValid API () is not allowing to have URI object with empty authority #149

Closed pranavishere2 closed 2 months ago

pranavishere2 commented 2 months ago

Code snippet: v1::UUri uri; uri.set_authority_name(""); uri.set_ue_id(0x10010001); uri.set_ue_version_major(0xFE); uri.set_resource_id(0x7500); auto [valid, reason] = isValid(uri);

Expected Result: It should result valid as true. Authority can be empty as per the spec https://github.com/eclipse-uprotocol/up-spec/blob/main/basics/uri.adoc. Refer section 3.1.Examples

Actual Result: It returns valid as false and reason as Reason::EMPTY

billpittman commented 2 months ago

Yea I'll take a look.