Skip to content

Releases: mattiasnordqvist/Web-Anchor

v5.0.0

20 Dec 18:29
Compare
Choose a tag to compare

Breaking

  • Removed AliasTransformer (don't think this class was of any use).
  • Removed obsoleted NoChange-attribute.
  • Removed obsoleted ContentAsDictionary-attribute and related code.
  • Interfaces IHttpRequestFactory and IHttpResponseParser has been removed. If you used them to alter webanchors behaviour massively, you are using webanchor for something it wasn't intended to, but I think you havn't used them.
  • The attribute-extensions GetAttributesChain are removed. (New methods, with different meaning but same name, has been added to Parameter. Don't mix up.)
  • Precedence of attributes has been changed.
    Before: First all parameterListTransformers, then all parameterTransformers.
    Now: First all parameterListTransformers and parameterTransformers on interface level, then all parameterListTransformers and parameterTransformers on method level, then all parameterTransformers on parameter level,

Breaking but easily fixed

  • Moved HttpAttribute, GetAttribute, PostAttribute, DeleteAttribute and PutAttribute to WebAnchor.Attributes.URL
  • Moved BaseLocationAttribute to WebAnchor.Attributes.URL
  • Moved HeaderAttribute to WebAnchor.Attributes.Header
  • Moved ContentAttribute to WebAnchor.Attributes.Content
  • Moved AliasAttribute to WebAnchor.Attributes.Parameters
  • Moved AuthorizationAttribute to WebAnchor.Attributes.Header
  • Renamed ParameterTransformContext to RequestTransformContext
  • Setting FormatFormattable has been replaced with a replacable implementation on property ParameterValueFormatter. Default behaviour is unchanged. The DefaultParameterValueFormatter can be configured through it's properties after it has been cast.
  • ParameterListTransformerAttribute.Apply now accepts a RequestTransformContext instead of a ParameterTransformContext. Everything in it should remain, with maybe slight changes. Example:
    parameterTransformContext.MethodInfo -> requestTransformContext.ApiInvocation.Method.
  • ISettings changed name to IApiSettings
  • ApiSettings changed name to DefaultApiSettings
  • Settings in DefaultApiSettings has been split into Request and Response.
  • Header and Authorization-attributes for method and api-level has changed name to AddHeader and AddAuthorization respectively, to avoid conflicts with Header-attribute for parameters.
  • ParameterListTransformerBase has been removed. Just inherit ParameterListTransformerAttribute or implement IParameterListTransformer.
  • IApiSettings.PreservePathInUrlSegmentParameters changed name to EncodeUrlSegmentSeparatorsInUrlSegmentSubstitutions (realize that it's meaning is inverted, but default should behave the same).
  • The ContentAttribute no longer has any parameters. Use addition attribute FormUrlEncodedAttribute or JsonAttribute to modify content-serialization on parameter level.
  • Parameter object can now only be created through static factory methods. This new api should be a lot cleaner.
  • Some properties on Parameter has changed names.
  • The Value-property of Parameter has changed name to Values and type to IEnumerable of object. At all places where you before only passed one value, you should now pass a list with that single value.

New features

  • #73 AttributeTransformers can now validate the api.
  • All HttpAttributes now has an empty constructor, working just like passing an empty string. [Get("")] == [Get]
  • Modifying the DefaultApiSettings through a configuring action at creation time has been added to Api.
  • A copy of the api settings is created for every request made, and passed to parametertransformers as a RequestTransformContext, to allow more finegrained request-creation.
  • How list query params are handled is now configurable through the settings.QueryParameterListStrategy.
  • There is now built-in code to comma-separate query-param-lists. Use the DelimitedQueryParamaterListStrategy.
  • Also Header-values are now formatted thorugh the ParameterValueFormatter. Before, only Query and Route parameters where formatted.
  • Parameter.GetAttributesChain is a new method that traverses through parent parameters. Parent parameters were earler used to facilitate handling of lists, but this is no longer the case. Parent parameters may loose their place in the future.

Bugfixes

  • Fixed #78 BaseLocation subsitutions
  • Fixed #81 Transformation Precedence

v4.1.1

04 Dec 12:39
Compare
Choose a tag to compare

Oops. Should have tagged 4921097

Obsoleting code that does not really bring great value to WebAnchor. If you any of the obsoleted code, you can always make a copy from the old source. Remember though that there are some issues with the ToDictionary-extension-method. #38

  • Obsoleted NoChange-attribute
  • Obsoleted ContentAsDictionary-attribute

v4.1.0

23 Nov 12:39
0fef7a0
Compare
Choose a tag to compare

WebAnchor should work in both framework and netcore apps now. I hope.
Thanks to @spinit-moom for dotnetcore-ing the whole thing.

v4.0.0

21 Nov 23:11
Compare
Choose a tag to compare

This release has some dependency problems. Will be resolved as soon as possible. See #75 . (Need help)
In the meantime, if you install v4.0.0, please also install System.Reflection.TypeExtension

  • Targeting .net standard 1.5.
  • ApiFactory no longer available. Use Api.For.
  • Renaming some stuff.
    • Parameter.ParameterValue -> SourceValue
    • Parameter.ParameterInfo -> SourceParameterInfo
    • Parameter.Type -> SourceType
    • AsDictionaryAttribute -> ContentAsDictionaryAttribute
    • PreservePathInUrlSegmentParameters -> TreatUrlSegmentSeparatorsInUrlSegmentSubstitutionsAsUrlSegmentSeparators (not sure if this was any better)

Added a new AddHeader-attribute which you can use like this on method or interface-level.
[AddHeader("Authorization", "Basic 79iou342qkras9")]

v3.0.77

13 Jun 08:49
Compare
Choose a tag to compare

Updating some dependencies

v2.5.75

22 Feb 14:16
Compare
Choose a tag to compare

Thanks to https://github.com/mikaelrjohansson a memory leakage was found and fixed.

Merged #66

Breaking change if you are using the ApiFactory directly instead of Api.For. If you are, just pass in a ProxyGenerator in the ApiFactory constructor. This ProxyGenerator should be a single instance in your code, so that you'll use the same generator for each ApiFactory, or dispose of it properly.

v2.4.68

14 Dec 23:15
Compare
Choose a tag to compare

#62 ToDictionary fails on Lists of primitives

v2.3.64

30 Nov 20:14
Compare
Choose a tag to compare

#58 Dependencies are not listed at NuGet

Release 2.2.60

28 Nov 11:45
Compare
Choose a tag to compare

#59 You don't always want to UrlEncode your url segment substitutions
#60 Memory leak

Release 2.1.35

11 Nov 20:15
Compare
Choose a tag to compare

#56 ConfigureAwait(false) (Could be BREAKING but more likely to be FIXING)
#57 Headers and Authorization