Skip to content

Stdlib::Http::Method: Add new type for http methods #1192

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

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

b4ldr
Copy link
Collaborator

@b4ldr b4ldr commented Jul 6, 2021

This PR creates new new resources:

  • Stdlib::Http::Method for validating http methods
  • Stdlib::Http::Status This is just a copy of Stdlib::Httpstatus
  • make Stdlib::Httpstatus and alias to Stdlib::Http::Status

Ideally we would deprecate Stdlib::Httpstatus in favour of
Stdlib::Http::Status

@b4ldr b4ldr requested a review from a team as a code owner July 6, 2021 13:58
Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Makes sense to me but I'd drop the Puppet >= 4.5 part in the tests since it's not supported anyway.

This PR creates new new resources:
 * Stdlib::Http::Method for validating http methods
 * Stdlib::Http::Status This is just a copy of Stdlib::Httpstatus
 * make Stdlib::Httpstatus and alias to Stdlib::Http::Status

Ideally we would deprecate Stdlib::Httpstatus in favour of
Stdlib::Http::Status
@b4ldr b4ldr force-pushed the feature/https_method branch from b4ebf99 to 6c3aa83 Compare July 6, 2021 14:19
Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I also just realized this may generate additional things in REFERENCE.md. Would you mind regenerating that and making sure the output makes sense?

@@ -1 +1 @@
type Stdlib::HttpStatus = Integer[100, 599]
type Stdlib::HttpStatus = Stdlib::Http::Status
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if this type can be deprecated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i would also like to deprecate this in favour of Stdlib::Http::Status but not sure of the process for that. i regret not namespacing this when i first introduced it :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can always do this bit in a separate pr if that makes things easier?

@b4ldr
Copy link
Collaborator Author

b4ldr commented Jul 6, 2021

I also just realized this may generate additional things in REFERENCE.md. Would you mind regenerating that and making sure the output makes sense?

We end up with two sections for http status

 
+### <a name="stdlibhttpmethod"></a>`Stdlib::Http::Method`
+
+https://www.iana.org/assignments/http-methods/http-methods.xhtml
+
+Alias of
+
+```puppet
+Enum['ACL', 'BASELINE-CONTROL', 'BIND', 'CHECKIN', 'CHECKOUT', 'CONNECT', 'COPY', 'DELETE', 'GET', 'HEAD', 'LABEL', 'LINK', 'LOCK', 'MERGE', 'MKACTIVITY', 'MKCALENDAR', 'MKCOL', 'MKREDIRECTREF', 'MKWORKSPACE', 'MOVE', 'OPTIONS', 'ORDERPATCH', 'PATCH', 'POST', 'PRI', 'PROPFIND', 'PROPPATCH', 'PUT', 'REBIND', 'REPORT', 'SEARCH', 'TRACE', 'UNBIND', 'UNCHECKOUT', 'UNLINK', 'UNLOCK', 'UPDATE', 'UPDATEREDIRECTREF', 'VERSION-CONTROL']
+```
+
+### <a name="stdlibhttpstatus"></a>`Stdlib::Http::Status`
+
+The Stdlib::Http::Status data type.
+
+Alias of
+
+```puppet
+Integer[100, 599]
+```
+
 ### <a name="stdlibhttpstatus"></a>`Stdlib::HttpStatus`
 
 The Stdlib::HttpStatus data type.
@@ -6777,7 +6865,7 @@ The Stdlib::HttpStatus data type.
 Alias of
 
 ```puppet
-Integer[100, 599]
+Stdlib::Http::Status

@michaeltlombardi michaeltlombardi merged commit 6c3aa83 into puppetlabs:main Jul 12, 2021
@michaeltlombardi
Copy link
Contributor

Test Failure unrelated; this was based on the #1193, which passed.

@b4ldr
Copy link
Collaborator Author

b4ldr commented Mar 8, 2023

Im not sure what happened to this but i don't see it in the history https://github.com/puppetlabs/puppetlabs-stdlib/commits/main/types :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants