Skip to content

Completely deprecate uri #281

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
May 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Version 0.5.0

To be released.

### Language

- The `uri` type has completly gone; use `url` instead. [[#126], [#281] by Jonghun Park]

[#126]: https://github.com/spoqa/nirum/issues/126
[#281]: https://github.com/spoqa/nirum/pull/281


Version 0.4.0
-------------
Expand Down
2 changes: 0 additions & 2 deletions src/Nirum/Constructs/Module.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ coreTypes =
, decl' "bool" Bool Boolean
, decl' "uuid" Uuid String
, decl' "url" Url String
-- FIXME: deprecated
, decl' "uri" Url String
]
where
decl' name prim json =
Expand Down
2 changes: 0 additions & 2 deletions test/nirum_fixture/fixture/foo.nrm
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,3 @@ record name-shadowing-field-record (
union optional-union = foo ( int32? bar )
| baz ( int32 qux )
;

unboxed website (uri);
14 changes: 1 addition & 13 deletions test/python/primitive_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Point1, Point2, Point3d, Pop, PingService, Product,
RecordWithMap, RecordWithOptionalRecordField,
Rnb, RpcError, Run, Song, Status, Stop, Way,
Website, WesternName)
WesternName)
from fixture.foo.bar import PathUnbox, IntUnbox, Point
from fixture.qux import Path, Name
from fixture.reserved_keyword_enum import ReservedKeywordEnum
Expand Down Expand Up @@ -538,15 +538,3 @@ def test_name_shadowing_field():
assert "bytes must be a value of {0}, not ['invalid']".format(
'bytes' if PY3 else 'str'
) == str(ei.value)


def test_uri():
""" Deprecated
"""
assert isinstance(Website, type)
website = Website(u'https://nirum.org')
assert website.value == u'https://nirum.org'
assert website.__nirum_serialize__() == u'https://nirum.org'
assert Website.__nirum_deserialize__(u'https://nirum.org') == website
with raises(ValueError):
Website(u'https://nirum.org\n')
4 changes: 2 additions & 2 deletions test/python/validation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def test_datetime_value_error():
DatetimeUnboxed(datetime.datetime(2018, 3, 11, 5, 27))


def test_uri_value_error():
def test_url_value_error():
Product(name=u'', sale=True, url=None) # url field is optional here
Product(name=u'', sale=True, url='http://example.com/')
with raises(ValueError):
# URI cannot contain new lines
# URL cannot contain new lines
Product(name=u'', sale=True, url='http://example.com/\n')