Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metadata): implement GET Units of Measure API #4127

Merged
merged 2 commits into from
Aug 18, 2022
Merged

feat(metadata): implement GET Units of Measure API #4127

merged 2 commits into from
Aug 18, 2022

Conversation

chr1shung
Copy link
Member

@chr1shung chr1shung commented Aug 17, 2022

dependent on edgexfoundry/go-mod-core-contracts#756

cbc81fb updated uom.toml configuration structure in order to return similar content for json/toml response.

fix #3957

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?) The API document is also updated in this PR.

Testing Instructions

  1. Run core-metadata from this branch
$ curl localhost:59881/api/v2/uom
{
    "apiVersion": "v2",
    "statusCode": 200,
    "uom": {
        "source": "reference to source for all UoM if not specified below",
        "units": {
            "temperature": {
                "source": "www.weather.com",
                "values": [
                    "C",
                    "F",
                    "K"
                ]
            },
            "weights": {
                "source": "www.usa.gov/federal-agencies/weights-and-measures-division",
                "values": [
                    "lbs",
                    "ounces",
                    "kilos",
                    "grams"
                ]
            }
        }
    }
}

$ curl -H "Accept: application/toml" localhost:59881/api/v2/uom
Source = "reference to source for all UoM if not specified below"

[Units]

  [Units.temperature]
    Source = "www.weather.com"
    Values = ["C", "F", "K"]

  [Units.weights]
    Source = "www.usa.gov/federal-agencies/weights-and-measures-division"
    Values = ["lbs", "ounces", "kilos", "grams"]

New Dependency Instructions (If applicable)

Signed-off-by: Chris Hung <chris@iotechsys.com>
@chr1shung chr1shung marked this pull request as ready for review August 17, 2022 16:06
@lenny-goodell
Copy link
Member

@hahattan , I noticed the I am not introducing a breaking change isn't checked in the PR checklist above. I assume this was just missed and there are not breaking changes :-)

@chr1shung
Copy link
Member Author

@hahattan , I noticed the I am not introducing a breaking change isn't checked in the PR checklist above. I assume this was just missed and there are not breaking changes :-)

not sure whether updating the uom.toml is a breaking change so I left it unchecked

Signed-off-by: Chris Hung <chris@iotechsys.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cloudxxx8
Copy link
Member

@hahattan , I noticed the I am not introducing a breaking change isn't checked in the PR checklist above. I assume this was just missed and there are not breaking changes :-)

not sure whether updating the uom.toml is a breaking change so I left it unchecked

it's not a breaking change, because this file didn't exist in the previous release

Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lenny-goodell lenny-goodell merged commit de42c75 into edgexfoundry:main Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Unit of Measure (UoM) ADR
3 participants